{"_id": "CYhj6BF2vwG8Wrw5g", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "G7Df25PJzjfSk7354", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 09:52:36"} {"_id": "fNSiTf4nrLvWLcXgz", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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\tall c:Class | some Person.(c.Groups) implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AmfTya7ffm3PXe6Yc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 12:14:51"} {"_id": "uJiyPKz68WeLoXHeY", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SPhWWd8aasWwtxLoR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:26:20"} {"_id": "XMC53NRwmW3fFDMo6", "cmd_i": 2, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ogSfWwJ6Qoiao9Cuy", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 21:20:26"} {"_id": "GB5pctBh2mrmXTnWT", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\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\tall c:Class,t:Teacher | some c.Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some c:Class,g:Group | some 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "5wMXvP6Z5ckSKnnhx", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-10 15:02:55"} {"_id": "AQo9gnzupvkPkDEEN", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall t : Teacher | t not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2 : Teacher, c : Class | t1 -> c in Teaches and t2 -> c in Teaches implies t1 = t2\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | c -> s in Groups\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}\n\n\n", "derivationOf": "3hCrWhq7G2HYFFT5a", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-18 17:36:32"} {"_id": "xDAwe6Xg778j8C2uN", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some q,r : Person | (p->q in Tutors or q->p in Tutors or p->r in Tutors or r->p in Tutors)\n \t\t\t\t\t\t\t\t\t\t\timplies (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "pLu3Jbfk3BMLicSLX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 20:25:42"} {"_id": "PoauyKHfY3eaThsAv", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class , t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c,d:Class | t->c in Teaches and t->d in Teaches implies c=d\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 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\tall t: Teacher, c: Class | t->c in Teaches implies some s:Student, g:Group | c->s->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher|some c: Class | t->c in Teaches implies some s:Student, g:Group | c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "HT8LsRonwKd6DKDyb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:51:41"} {"_id": "rBDtKs5uMj3BDnjqB", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xzYsWDTnDEprtHsE4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:28:30"} {"_id": "YoTC59YzKmkXxavcm", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rGCvdtF5F84aqiJ3o", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 20:33:55"} {"_id": "BLr6RrzZ98gPieiiT", "cmd_i": 6, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every 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\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\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \t\n \n \t\n \tall t:Teacher | some c:Class,g:Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "BdpWjcDBvzdKytWxi", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 11:16:42"} {"_id": "egr9xB5dsgxqqqmqq", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies p in Student and some t : Teacher | t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "58YhdC4SywuaPucrK", "msg": "The name \"p\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 21:17:36"} {"_id": "HmLyiepCpxMfdchhe", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\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\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xt4ADbs3dC4xJhn5p", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-28 21:48:01"} {"_id": "wgzPbwANMj3uTFLo3", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:36:35"} {"_id": "68qBaJKzRPZWq2ZbH", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | Teacher in Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DhoqKpdLjassC7Lrg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 18:43:56"} {"_id": "H2KMqm3RYFJviH2ez", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "P8hy2oGL6d5uGaoFA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:39:19"} {"_id": "78PxnyeSzTQDx7Lvg", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:21:34"} {"_id": "7x83YCsmk5BNEF2KR", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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 in Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uboqhHCkLpNbKYz9k", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 18:07:54"} {"_id": "uKbWNDcgWj4c6vxGd", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DuFWf5GXiLX8Pm8mk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:29:28"} {"_id": "HZYcMWTtiecsjC6Do", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t:Teacher,s:Student | s->t not in Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PLEeub8SREbioRZTe", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 18:58:44"} {"_id": "NLhu58tu7ZamdMw9D", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | all y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "24ZCaPwM98ggGjtyE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:15:11"} {"_id": "ogBLJhMeLgqXnQQnW", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher,some c:Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DASz5fkr8nLFvHcdY", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-2 15:30:38"} {"_id": "zMAdjAzEm3HaBKcG4", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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 g : Group, s : Person | c -> s -> g in Groups) implies some t : Teacher | t -> c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Person, c : Class, t : Person, g : Group | (c -> s -> g in Groups) and t -> c in Teaches implies t -> s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n all p1 : Person | (some p2 : Teacher | p2 -> p1 in Tutors) or (some p2, p3 : Person | p2 -> p1 in Tutors and p3 -> p2 in Tutors and p3 in Teacher)\n}", "derivationOf": "tMonpQ8fG7F3zr9RG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:42:06"} {"_id": "4puWnHkvEPsS83DzN", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher|some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5zobFWoWh3tRuXuLy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-1 17:51:34"} {"_id": "PnCX5FHXhgQimt9Ki", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PJTLns64NpnuBavck", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:09:08"} {"_id": "TQGrFwJA8BYNYNwtJ", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher)\n \t\t\t\t and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "emAr2t4JWLgGXz6us", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-29 16:28:36"} {"_id": "AfAAoDjRXwXSbKaqh", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student | all g:Group |some t:Teacher| c->s->g in Groups implies t->c in Teaches\n \n \n \n \n \n all c:Class,g:Group,s:Student | some t:Teacher | ( c->s->g in Groups) implies t->c in Teaches\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t:Teacher | all c:Class |some g:Group | t in Person\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Cc4LJQXkzamsK34t5", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 14:10:47"} {"_id": "YSTRtJQFKQzycZDZ7", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DHpPesE6Sz3RAxw8t", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:26:14"} {"_id": "PxMqcyJ25aerogp56", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "GKm6vj8KJL6oeo5x2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-21 10:31:46"} {"_id": "j4YEJPoGEkpfMnhuc", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , g:Group | c in Class\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\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9gLCDnfFhjtWWYnGZ", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:15:32"} {"_id": "MfmenaFa4bLLPR4kT", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\n \t\n \t\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\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n \t\n}", "derivationOf": "tsJaTaNNSuMox2ix8", "original": "YH3ANm7Y5Qe5dSYem", "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": 222, "y": 199}, "Class1": {"x": 444, "y": 199}, "Class2": {"x": 666, "y": 199}, "Group0": {"x": 222, "y": 298.5}, "Group1": {"x": 444, "y": 298.5}, "Group2": {"x": 666, "y": 298.5}, "Person": {"x": 444, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "this/Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "this/Teacher:Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "this/Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "inherit", "type": "this/Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "this/Student:Person", "visibility": false}]}}, "time": "2019-11-4 20:26:52"} {"_id": "tWi4twPeeJuCWkQFw", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TCqPCRwqvyhAnfPcK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 12:27:30"} {"_id": "Eg6SxJS8e59o3YQPA", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "2vicuYYZfXhn7xyoq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-17 09:43:51"} {"_id": "Zux6XcGER3A7A4mHr", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher | some y : Class, z : Group, v : Person | x->y in Teaches and y->v->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n\npred inv14 {\n all x : Person, y : Class, v : Teacher | ((some z : Group | y->x->z in Groups) and v->y in Teaches) implies v->x in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PEkE4Q94DTc2J9QRX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:45:38"} {"_id": "roX7tPFMGWSEXQZhC", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n \n all c:Class,s:Student,t:Teacher, g:Group| some s.(c.Groups)->g and some t.(c.Groups)->g implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "mXZ3AioMBZ5EkvSih", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 21:17:46"} {"_id": "JCbaCgvPtNGCqCy9c", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n all x, y, z : Person | x->y in Tutors and y->z Tutors implies z in Teacher\n}", "derivationOf": "78AK6xwg9qbwzovfB", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 19:12:26"} {"_id": "RKmozHo8yFkH9HJSp", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class,t:Teacher | s in c.Groups.Group\n\n }\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "NEEweseJeXuAueNXe", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-12-2 11:45:14"} {"_id": "DGXSMJkbktqYQkkbT", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class, g: Group, s: Student | some t: Teacher | c->s->g in Groups implies (t->c in Teaches and t != s)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | some g: Group, c: Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zZSzfsWAQGXMTCmpK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-30 22:28:39"} {"_id": "6n9EjwoxXutjty3P7", "cmd_i": 1, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qkb4Z4E46RDj6mBKL", "msg": "The name \"Teachers\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:32:08"} {"_id": "3EEs5aZNhGozBy4BB", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rjva8b5tpkdWeZ8up", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-30 21:58:45"} {"_id": "p5Syh8eoKWbphPGkG", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, p : Person, g : Group | c->p->g in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\tall s, t : Person, c : Class | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p,q,r : Person | (p->q in Tutors or q->p in Tutors or q->r in Tutors or r->q in Tutors \n \t\t\t\t\t or r->p in Tutors or p->r in Tutors)\n \t\t\t\t\t\t implies (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "naH4xwBYuJMAm3Phb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 20:51:18"} {"_id": "uZzWkKTBydF7ahEEA", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n \tall p : Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n\npred inv5 {\n\tall t : Teacher | some c : Class | teaches_class[t,c]\n}\n\npred teaches_class[t : Teacher, c : Class] {\n \tt->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cHMKd3LHCFFx2yQeX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:30:08"} {"_id": "bmSWkACMgrTCcL6ZG", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | c in t.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\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 | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | Class->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7f8eXF5QvepzT74oW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-21 18:04:00"} {"_id": "6z8C8zebLfKGaiifP", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class 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 | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:17:15"} {"_id": "oMhrgAfBiDG5A3u74", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kMfG6grjFax3T4X9h", "original": "YH3ANm7Y5Qe5dSYem", "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": 286.08331298828125, "y": 265.3333333333333}, "Person": {"x": 286.08331298828125, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "this/Teacher:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "this/Student:Person"}, {"color": "inherit", "type": "this/Teacher:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "this/Teacher:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}]}}, "time": "2019-11-3 00:23:00"} {"_id": "uqJGrhLBr5GP57WtR", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 all c : Class | all s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all t : Person | (t -> c not in Teaches) implies (all p : Person, g : Group | c -> p -> g not in Groups) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Person, c : Class, t : Person, g : Group | (c -> s -> g in Groups) and t -> c in Teaches implies t -> s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n some p1, p2, p3 : Person | p1 -> p2 in Tutors and p2 -> p3 in Tutors and p1 in Teacher\n}", "derivationOf": "BjKxKRss7h7rhsm6D", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:22:05"} {"_id": "YpzFk6faEtAZsNrhG", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "aCnirAsoZxTQiN2vX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 15:49:13"} {"_id": "RBBeH4egjera7gd2u", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Person | x in Teacher implies x 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KH4aQhM83CBNC4jc5", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:26:44"} {"_id": "fHm6Mdw334fKcfQQW", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nall x,y : Teacher | x->y 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oLdB8foP83xThJxtH", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:13:08"} {"_id": "nXCRRiERcsNFJQxck", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y in Student | y in Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hBhKsyDG3GYgCDcCh", "msg": "There are 3 possible tokens that can appear here:\n, : =", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:35:26"} {"_id": "Fsqm4AKyRuPLPGajh", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some x : Teacher | all y : Class | x->y 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "v7vWx6BuAXusK6rhQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 12:01:33"} {"_id": "g7u326D4vN9Cxb6dW", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some p : Person, g : Group, c : Class | t->c implies c->p->g in Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9jWtRQputwATeP2fa", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 11:11:32"} {"_id": "pb65cuQSfSRnHAiBj", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "axbEn2XbqPTh2fNQf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:27:05"} {"_id": "i7ZYPCaCeAsqo8ABc", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \tno Person.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "nEggBtd3iKeCfWS8u", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:55:22"} {"_id": "Ycgc5h6cpNEqR34jj", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | c in t.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\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 | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fp3uHgem8PeCfu5yg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-21 16:49:00"} {"_id": "WZpYHspybnyZgYpwo", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NgM4ePm89ixzRwdqM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:20:10"} {"_id": "aatmdScSRnB2WhE5G", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n \tall p:Person | p not in Teacher \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher, some c:Class | t->c in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "F59oGGd6tj5aK3cNZ", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-28 16:51:37"} {"_id": "mvKkn3EoWJjdRhast", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student|some t:Teacher, g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n\npred inv12 {\n\tall t:Teacher , s:Student | some g:Group ,c:Class| t->c in Teaches and c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1:Person, p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class , t:Teacher, g:Group|some s:Student | (t->c in Teaches and c->s->g in Groups) implies t->s in Tutors\n}\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mpi4uSgPgXJxt9d7E", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:45:38"} {"_id": "pswGGhhzFbJSWhXF6", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher,c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nu7shKWWFqK6Bg7ZA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:40:29"} {"_id": "PvKLE8sZtjxPZ3RE4", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mjgsuLkf3GcJHw3yJ", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 19:05:24"} {"_id": "s2p59BdQsqrxD9ek5", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rG6MaK6uQYrcoDSWa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:49:07"} {"_id": "Dg9QgA8rfTqrP3q2K", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "H5gFwKmGrocQuEWDk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:41:23"} {"_id": "BDQMqmxYmYu35tB8s", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 17:17:58"} {"_id": "BdoexS2DqnqkqTwr6", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BZwBsHmq2EqWqk5wp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 20:29:26"} {"_id": "bDYMTLWxvDMW4ypBo", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class , 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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall p:Person | p in Teacher implies some g:Group | p in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t Person.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "Fu73f6JPogNpsvvi3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-12-1 18:31:38"} {"_id": "8AEJmmcEjBpnhA3Dm", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qv5i3BcFG2YvrpXmx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-21 16:42:02"} {"_id": "89sJw8EcM2venQSdc", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, g : Group | c->t->g in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qTxFZzazApf8f9TFZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:00:41"} {"_id": "P32XZRDjF8ffQNg8j", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome p:Teacher,c:Class | p->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cgJWYLDGjbgfLs5Mw", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:37:23"} {"_id": "MWvdNiF7ZLqLuw9uH", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "d57Y6rnY8RLywudfp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 23:51:06"} {"_id": "NskmnLkuRmo4zETYk", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p not in Student and p not in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CYfijaEatPxomcxPz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 10:35:58"} {"_id": "CftXM3aTXbbTt7oKm", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall p:Person, c:Class, g:Group | (some t:Teacher | c->p->g in Groups implies t->c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student \n}\n\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4kZTi5WoLmeBSm3st", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 00:05:58"} {"_id": "YKDK37XDEL4uZoiQM", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tTeacher.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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2s5TMKv8AEns4DFdu", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:38:30"} {"_id": "LeWTaD3nsKihEmiht", "cmd_i": 12, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student|some t:Teacher, g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n\npred inv12 {\n\tall t:Teacher , s:Student | some g:Group ,c:Class| t->c in Teaches and c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p:Person | p in Tutors implies p in Teacher \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "G7kGRxgAdijA9LwtF", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:33:50"} {"_id": "Et3f9QEfu8xjbHFpA", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\npred inv11 {\n all c:Class,g:Group | some c.Groups.g implies some t:Teacher | t->c in Teaches\n}\n\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "AAnNi2upC56K3jdPc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-21 11:41:07"} {"_id": "LWAiqzBrgLd3wtNXu", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Classes | 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\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "msg": "The name \"Classes\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-30 21:55:47"} {"_id": "4ZDTd9yZbwBjXj7Xc", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sm8YyfxmcvKRDBB8A", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 18:23:53"} {"_id": "bgj7EcNXMsemaed9u", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\nall t : Teacher | some g : Group, c : Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\nall x,y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\nall s : Student | in Class implies some t : Teacher | t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PYYsQo7nsZ5amexnB", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 11:34:10"} {"_id": "C4A7Mh3BJFiYGjFLx", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class,g:Group |some t:Teacher | some c.Groups implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xAH3auhe68dzHwcEo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 11:00:29"} {"_id": "X4PtjK7fRYJnNpRmX", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class | some g : Group | c->s->g in Groups implies some t : Teacher | t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "edvHabFnajYDGYya2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:11:41"} {"_id": "YHvMMpJShvGYv5GHa", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cGg3wrXdd7DZRCxzT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 10:14:24"} {"_id": "4kLLEXKbhoPP7HXRH", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class | t->c in Teaches implies some p : Person | all g : Group | c->p->g in Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CZHFgLjmksaMCBW5v", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:19:13"} {"_id": "nPHXrXpeMhAe8Sbac", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ccXcpQnmKJ79fWgYc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:07:15"} {"_id": "3RFEqGTPsWJLwT8nE", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Teacher & no Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oXWk3FeeAfweWSR6L", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 16:44:01"} {"_id": "FrsAAMNrkuoDzubAh", "cmd_i": 6, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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:Teaches | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WLTxhtnbos8kYPtoM", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 09:16:38"} {"_id": "Zxi3ZfYohw5C2uX56", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher, y : Class, z : Group | y->x->z in Groups and x->y 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EPmfBjhGQdg8zGCSm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 12:34:07"} {"_id": "gPTiuk89T9fZmXNyb", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | c in t.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\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 | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some g:Group, t:Teacher,p:Person | c->p->g in Groups implies t.c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2rG9QemTAbxz6odyR", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is c (type = {this/Class})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-21 18:06:41"} {"_id": "qda7vzy3BcmESdv32", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\tall p:Person | some Teaches.p\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JaYv9bemiKvTWvcFa", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 11:24:29"} {"_id": "5WMX3H6QQAPzbdfQ9", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class , y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nsome x : Class | some y : Teacher | some g : Group | x->y->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "K9SiRx5Htwd4NYdqW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:45:09"} {"_id": "tZFAYauifuYzrNfHZ", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class|some t:Teacher | t->c in Teaches and one s.(c.Groups) and one t.(c.Groups) implies t in s.^Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "f3wesMziizf3ShMWv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:39:49"} {"_id": "cLMseQpu48X2MLbpb", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1:Person, p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FLBQMvjBSWdmCJLNE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 17:32:33"} {"_id": "XfEi4qw7J3tKkfQp3", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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 ~(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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7m2XKRQQfKDs8Bhnr", "original": "YH3ANm7Y5Qe5dSYem", "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": 296, "y": 199}, "Class1": {"x": 592, "y": 199}, "Group": {"x": 444, "y": 298.5}, "Person0": {"x": 592, "y": 99.5}, "Person1": {"x": 296, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "this/Teacher:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "this/Student:Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "this/Teacher:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}]}}, "time": "2019-11-1 23:08:34"} {"_id": "WmXY34nY5See78o2v", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class , y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nsome x : Class | some y : Person | some g : Group | x->y->g in Groups implies y in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DpXXFvTMuowmTD7QD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:48:42"} {"_id": "ZQBsdpmQmSGtp6Z66", "cmd_i": 1, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\nrun some {Groups}", "derivationOf": "fEaBsSc2H9yt7ftep", "msg": "There are 4 possible tokens that can appear here:\nNAME seq this {", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 13:29:41"} {"_id": "7mWM9gGbSpeaC8A6H", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 { \n\tall p : Person | some c : Class, g : Group | c->p->g in Groups implies some t->p in Tutors and t : Teacher | t->c in Teaches\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "P5ZGGAzFbXxq3n6mX", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 15:43:52"} {"_id": "X4LfaRRoq3wTTh6dL", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TkK6zwehM78hJvAki", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 14:59:32"} {"_id": "8Ri5xaRN9P8L3GACL", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BpApw2vse8j7tSfw3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 23:44:29"} {"_id": "f4tNh8q8xRucRAAga", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t all c : Class| some t : Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n }\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some g : Group, t : Teacher | c->t->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aqaCvj4iBStb7SHkE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-9 00:29:52"} {"_id": "39xkjvdyEXDpztw3g", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tno Person.~(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "Svfcc2wNApZY8XiGF", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Group->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:24:09"} {"_id": "dgTwupu5e8G6fe6E8", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tPa9bZSmPt4WermWo", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-7 17:41:00"} {"_id": "fzsgkg5vXchtZqJfy", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\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\t\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "ZLEcx2qc5sYgf56T3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 10:35:41"} {"_id": "pbD8LcAvFoxZjRfpC", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | s in Class implies some t : Teacher | t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "u7Lqis8e4rZFheAtj", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:09:26"} {"_id": "kBNBcqEW4SLNLYc5j", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XASC6k6twHCgkDeyd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-1 18:00:45"} {"_id": "utx9WKywvd79e3WK2", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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 all c.Class | some t:Teacher | 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\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "wBT4ZRaeiFosvCfsq", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 12:52:21"} {"_id": "Qb8vLepZcZQs3RtHc", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\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\tall c:Class,g:Group,t:Teacher | c->g->t in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "j8hJ8DZg6EEBGPfKb", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Group->this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-10 14:57:59"} {"_id": "Zd7TP6HftWeWeTLiM", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall t : Teacher | t not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | not (p in Teacher and p in 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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SDmgz8aCvAP7WB67b", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-18 16:59:46"} {"_id": "yQRcW3cdeqTEDeCtC", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student | all g:Group |some t:Teacher| c->s->g in Groups implies t->c in Teaches\n \n \n \n \n \n all c:Class,g:Group,s:Student | some t:Teacher | ( c->s->g in Groups) implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "22c33R4ECiCdiSyMg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 13:58:45"} {"_id": "u9rzKyXbBGeZweLkp", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall t:Teacher | (some g:Group , c:Class | (t->c in Teaches) and (c->g in Groups))\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WTP4d5LnyGnJA9usr", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 12:02:10"} {"_id": "zX5MGppcNMctsgqnt", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,g:Group | some t:Teacher | c->t->g in Groups implies t->c in Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ffvDSJuekipBouyPf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 18:52:49"} {"_id": "tWDdiNMzhKu9QxzSb", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class | some t: Teacher , p: Person , g: Group| c->p->g in Groups implies (t->c in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | some g: Group, c: Class | (c->t->g in Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p:Person, p2: Person | p->p2 in Tutors implies (p in Teacher and p2 in Student)\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wbp4bi7uXgCvF6pnN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-30 22:39:00"} {"_id": "rzxfotGaGBofjzPWA", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ACQxqSDqnzxnN6Bmw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 12:53:59"} {"_id": "w3AuYgruGRvsmuy6Y", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SXrK8BDDH9nyZfWYh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 11:33:27"} {"_id": "hP94XARWn6WEdCSDG", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher,c:Class,g:Class | (t->c in Teaches) implies (t->g not in Teaches)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t,p:Teacher, c:Class | (t->c in Teaches) implies (p->c not 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gy4v8D52Yn8bHgY59", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:31:11"} {"_id": "fAciRcHWJGwBWPkbJ", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tno Class.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "ZYkDRHBXZMf2XTkW3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:22:23"} {"_id": "WB7MSNWZhzCj2gQbe", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | x->y in Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Pcj6GKkkbCG9SbfTe", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person}\nRight type = {this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:40:29"} {"_id": "iPDLgy6rgNd6fiuoo", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 14:38:43"} {"_id": "vAzjWB5XrQkKokWcG", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "GtjrCpw7MpJmgC45i", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-17 09:44:13"} {"_id": "iGLmPGBfJuLnbghfD", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class, g: Groups | some s: Student, t: Teacher | c->s->g in Groups implies t->c in Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "muoiJ2ugTQBooPh4M", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person->this/Class->this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-30 22:23:16"} {"_id": "Witx46GJwyEPgpfL8", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QpfYrNS2YeW7oHPHm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:24:44"} {"_id": "c5TExwY6BKBCt9CB6", "cmd_i": 6, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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.~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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kpdpJm2iuoB4PtmGh", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-30 18:29:51"} {"_id": "xdDkL4w4NsqY9vQs5", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n some Trash\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "fhGrGT6zWfcrHZKGz", "msg": "The name \"Trash\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 11:17:41"} {"_id": "zGfg5jo3CLK9xuEt3", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some t : Teacher, c : Class | t->c in Teaches implies t->s in Tutors | g : Group | c->s->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sW9WwcnmMbAi8oGWA", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 21:28:42"} {"_id": "AAhkmh7bYSqT6rtLw", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "pdzZxMvm5533BSeKv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-13 17:04:45"} {"_id": "mDBA7oafY6NHWYxv4", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some p : Person, g : Group, c : Class | t->c in Teaches implies c->p->g in Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "g7u326D4vN9Cxb6dW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:11:42"} {"_id": "geXe3pifaBXFPWeuP", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall Teaches.Class | one Teacher \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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JajfmcfpADsRJkvE2", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:52:47"} {"_id": "QbfmKpoFRy4GkqqZ9", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\t\n\n\n\tall c:Class | some Groups \n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "6XdJ7xy23z7R55itS", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:17:12"} {"_id": "yhziqF8gpF5bMA9RG", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student,t:Teacher | some s.(c.Groups) \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "Lkp7PxWgQFRBKqDLX", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 14:53:27"} {"_id": "c9vd2ih9z79JXmcQS", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t all c : Class| some t : Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t1,t2 : Teacher | some c : Class | t1->c and t2->c implies t1=t2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "n8QEzNqBtvhZ4PgPz", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-9 00:05:59"} {"_id": "edCabP7E286c3f2pL", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t all c : Class| some t : Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ofv4vDiousArs6q7t", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-9 00:10:02"} {"_id": "wX2pdnE453HnCYCCz", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlone Teacher in Teacher.teaches \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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LTQMAZFx7pKe79nE2", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:49:59"} {"_id": "qkCyj2GYiPiQqHCyQ", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\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 | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DGacWDrR26E4qXgdE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 11:55:21"} {"_id": "jR8jZhbNst5qWkuid", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AF7Qns5ngvibcxBWm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 09:50:19"} {"_id": "Ry4ncT9QHtTecGj9y", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class | some t:Teacher,g:Group | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "7pqMEZMva8pLL7fw8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-21 10:39:56"} {"_id": "vjWLw9f9bjBqKyJiK", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \n \t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t~Teaches.Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ieqPE5pkZzYHg7XsM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-2 15:47:33"} {"_id": "jsc9GnPAE6DXKMBHS", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall t:Teacher | (some g:Group | t->g in Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Xg4yEdo4nZ2ms9tRo", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 12:00:11"} {"_id": "Pr2K6S5RznXnjQdvq", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some t : Teacher, c : Class | t->s in Tutors and t->c in Teaches\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KcEucXcwkKExWyjLR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:24:20"} {"_id": "fvxxmh5GyFmFM4E5v", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YaYtoPoHBC2MD2RNk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-1 18:04:54"} {"_id": "a6YML64pAfYANDtsB", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some t : Teacher | some s : Student | some g : Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TkeMSRcTMC4RFJmyJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:24:29"} {"_id": "sF8TQNvQSnhb9AH3a", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall t:Teacher and 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KGBQ7rKxHxG5kXgSF", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:18:32"} {"_id": "BSh8LR4GBqYmkEo2C", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some q,r : Person, t : Teacher | t->p in Tutors or (q->p in Tutors and t->q in Tutors) or (t->r in Tutors and r->q in Tutors and q->p in Tutors)\n}", "derivationOf": "RXsuhsBhoCBzSAdmn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 05:55:15"} {"_id": "bgRTiiNu83L7oxL3W", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class, s : Student, g : Group | c->s->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6CC5sasXAxbWGmScs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:45:37"} {"_id": "fkFBuH79avq9n6JJP", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1,c2:Class,t:Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c:Class|some t:Teacher, g:Group | t->c in Teaches implies c->t->g in Groups\n \t\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qQuqYJtNGJA6okCeP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:22:19"} {"_id": "LDWW52qB2PDkGPpCK", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pxaGKTCgM6oNT6GJj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 21:23:03"} {"_id": "vpTzJnPMcah7tMXTd", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rJYhJfXrN9T2EsZ77", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 20:28:32"} {"_id": "hm6n7Psd6X5XFP2iA", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall t:Teacher | (some g:Group ,c:Class| t->c in Teaches and c->t->g in Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student \n}\n\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bubEt4a7FkffBwzmj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 23:24:45"} {"_id": "SqPysRNnaP3zsn6Fd", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n \n all c:Class,s:Student,t:Teacher, g:Group| some s.(c.Groups)->g and some t.(c.Groups)->g implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "ha9hPfSQaNTTk7kZ8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 21:18:04"} {"_id": "SLwdXpFieeoW9GC8c", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tTeacher in Person.^*Tutors and Student in Person.*Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XRtzx49dFv3oQSLZJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 21:14:36"} {"_id": "c8y4BgrWJ59AyF3jF", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "6tguwSDAwkhgJLmj8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-17 09:43:41"} {"_id": "MESt6ARMw8iWTQCw4", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "cXKGQ5ZWMkcycf3sY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-17 09:44:29"} {"_id": "YELub5j7cSciT7G85", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n some x, y, z : Person | x->y in Tutors and y->z in Tutors and x != y and x != z and y != z implies z in Teacher\n}", "derivationOf": "nqNu9JNgC8icwMjg3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 19:34:57"} {"_id": "xhAZJiJt7YiA37zCW", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class,g:Group|some t:Teacher | some Teacher\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "dXojDJJX8RoGdLdFR", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:34:40"} {"_id": "ATrtjtDdHEfHwqGgH", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\nall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies all t : Teacher | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SuLNadCvihzzdQYes", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:13:14"} {"_id": "3yh3zjGnYHFWAW8uf", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | s in c.Groups.Group implies some t:Teacher | t->c in Teaches and t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "qBdNTAxy7g4pZfSjD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-12-2 11:44:09"} {"_id": "7gFPtSGJC6sA7g3MG", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XGSvRZLhGKGBEFYGM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 20:59:46"} {"_id": "sBJgCzrPHXqxHZQi7", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher,c:Class,g:Class | (t->c in Teaches) implies (t->g not in Teaches)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,t:Teacher,g:Group,p:Person | c->p->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher, c:Class, s:Student | some g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wyKwteKBhNomS6J9q", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:52:39"} {"_id": "gpCpo5Btj9vPNLLgM", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\tall c : Class | t1, t2 : Teacher | t1 in Teaches.c & t2 in Teaches.c :> 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eMhKSQy7fYgmNfuvf", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 18:05:19"} {"_id": "bDBRjXhHmHZp8kQnh", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "pgaKN4uDvHpDQiLAi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 15:48:55"} {"_id": "TCqPCRwqvyhAnfPcK", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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, v : Teacher | x->y->z in Groups implies 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gNSxFLDyk9YTJYoQ4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 12:26:57"} {"_id": "kPWLLA5rgz5B6KsFH", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \tTeacher.Teaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SWDHRStbZDzNztdCH", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {univ->univ}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 18:10:00"} {"_id": "fjFwZAbL4Q53noc7x", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student +Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall p:Person | some p.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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KzfCQ6k9YuEJHa6gF", "msg": "This cannot be a legal relational join where\nleft hand side is p (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 11:29:04"} {"_id": "dZGrKfS9MuRgYcksS", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n Class in Teaches.~Class\n}\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SuFb4r8PHcHRdsdwh", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:29:16"} {"_id": "AkBwhkxx8h4SX4qHH", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \tall p, q : Person, c : Class | (some g : Group | c->p->g in Groups) and q->c in Teaches implies q->p in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tsome p,q,r : Person | (p->q in Tutors or q->p in Tutors) and (q->r in Tutors and r->q in Tutors) implies (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "fYka8qsP6k3wxX5nA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 16:04:46"} {"_id": "SBDZrRqRLi3kT6qR4", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hEMXJ7KYKej6fRpFK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-10 14:55:25"} {"_id": "ozayx89o7eJYGPhSd", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n \tall p:Person | p not in Teacher \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher; some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "28BwvP45Xe27iahQC", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-28 16:52:06"} {"_id": "nkbEhXPd8BLoSKCqu", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "XNPQ9Q5F8rkqhCas3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-21 10:31:41"} {"_id": "SDmgz8aCvAP7WB67b", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall t : Teacher | t not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | not (p in Teacher and p in 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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tHMfXqpYePtZF35X7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-18 16:59:42"} {"_id": "nivHQCYLv8okTwfbK", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n \tall p : Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | (some c : Class | t->c in Teaches)\n}\n\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | (some t : Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8G9Rvis74hQdJsy8P", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:40:09"} {"_id": "bwK3czNndeQ32j96c", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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\tall c:Class | some Person.(c.Groups) implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n \t \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "EyD9fMN7xrScmtLCm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 12:21:29"} {"_id": "htkfSNmAxDif5Ynxk", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some c.~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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tNsgE6dgMrncBEMK7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-13 16:10:01"} {"_id": "ozJg8mTLxXx2kCWZy", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,t:Teacher,g:Group | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "ejnSWkJKzew6x5W69", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:24:49"} {"_id": "ZTyJTkp9KCvDQvKoR", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "9a3wEWm55TdvvYYfS", "original": "YH3ANm7Y5Qe5dSYem", "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": 666, "y": 199}, "Group": {"x": 444, "y": 199}, "Person": {"x": 222, "y": 199}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "this/Teacher:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "this/Student:Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "this/Teacher:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}]}}, "time": "2019-11-8 16:02:53"} {"_id": "idS2wduL5v9zPvTZJ", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher,c:Class,g:Class | (t->c in Teaches) implies (t->g not in Teaches)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t=p\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,t:Teacher,g:Group,s:Student | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher, c:Class, s:Student | some g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NHZRa9cLPk2m2Q4GQ", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:51:28"} {"_id": "XmkA7CjfncRcZEekR", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "G4mER8JZ5aEYv8f5x", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:23:59"} {"_id": "aZJ5y8yywgcZC2nph", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c :Class, s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QNrnABbThw6x73WQe", "original": "YH3ANm7Y5Qe5dSYem", "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": {"Group": {"x": 592, "y": 199}, "Person": {"x": 296, "y": 199}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "seq/Int"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "this/Teacher:Person"}, {"color": "inherit", "type": "seq/Int"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "seq/Int"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}]}}, "time": "2020-1-7 22:39:09"} {"_id": "x4QvWmo9BC8vPGjHG", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KwgiJu8WBuNrgPwpf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 11:11:32"} {"_id": "pLu3Jbfk3BMLicSLX", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some q,r : Person | (p->q in Tutors or q->p in tutors or p->r in Tutors or r->p in Tutors)\n \t\t\t\t\t\t\t\t\t\t\timplies (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "msg": "The name \"tutors\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 20:25:34"} {"_id": "wLuQ5mJ7ipgjsGTdP", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | c in t.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\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 | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some g:Group, t:Teacher,p:Person | c->Person->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tKm3W6iRapFFuE9BD", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-21 18:06:11"} {"_id": "GqjJiPzZL9EytfhBu", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 12:10:49"} {"_id": "gmZLJ2Geur2PJ2K5B", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yQFj3Ri3jeW4GFZkG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:23:27"} {"_id": "FRArH9kSkgvApSnJi", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zBLJrLiJua8oWzS2n", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-4 18:02:17"} {"_id": "MBrL7qx6a5EasoTKP", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "C7JZ4we6w42LQTJtA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 20:25:38"} {"_id": "v3shj8hLdQN7yoFwu", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "g95kaNbBvMAe8pNAb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:10:57"} {"_id": "SyaEivQ7DDJWzbvrp", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YyJa2kBDCA4JLhZLq", "msg": "The name \"teaches\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 23:57:02"} {"_id": "YQyZKu2S8hzjMeNjW", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher,c:Class,g:Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zcRQ55GrG7pnNNMCE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 18:55:48"} {"_id": "nzmQyEK4WHCh7Kivw", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | c : Class, g : Group | c->s->g in Groups implies some t : Teacher | t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FZNm6KWWN2SRAnS2x", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 21:07:39"} {"_id": "iSgxcL5btiimsF3nr", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | c in t.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\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 | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | 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\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tR8wKsxJ5MbBWrh8H", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-21 16:52:02"} {"_id": "NptAjnBHeKaZpR4Nb", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aofTxDG9vk9YkatuT", "original": "YH3ANm7Y5Qe5dSYem", "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": "Int"}], "metaSubsetSigs": []}, "nodePositions": {"Class0": {"x": 666, "y": 132.66666666666666}, "Class1": {"x": 444, "y": 132.66666666666666}, "Class2": {"x": 177.60000000000002, "y": 265.3333333333333}, "Group0": {"x": 355.2, "y": 265.3333333333333}, "Group1": {"x": 532.8, "y": 265.3333333333333}, "Group2": {"x": 710.4, "y": 265.3333333333333}, "Person": {"x": 222, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}]}}, "time": "2019-10-2 10:55:22"} {"_id": "j5FJExfKL6t5eHZrQ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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 t : Person, c : Class | (some g : Group | some s : Person | c -> s -> g in Groups) implies t -> c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Person, c : Class, t : Person, g : Group | (c -> s -> g in Groups) and t -> c in Teaches implies t -> s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n some p1, p2, p3 : Person | p1 -> p2 in Tutors and p2 -> p3 in Tutors and p1 in Teacher\n \n}", "derivationOf": "tpCuC5hftcQguHmFu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:29:18"} {"_id": "yLKenegu2zkdtX4qp", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RBguQ2qaGesNBSrPy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 10:31:07"} {"_id": "umsim8WXG3fc3hpiX", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all s : Student | all g : Group | c->s->g in Groups implies (some t : Teacher | t->c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vmtfsj4Tg26M56ok3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:35:28"} {"_id": "aofTxDG9vk9YkatuT", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "v2KuPo8LXDSKbPuty", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 10:54:37"} {"_id": "SXrK8BDDH9nyZfWYh", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JhfEw4NbGN2Z55EiL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 11:32:46"} {"_id": "FHTjZ5cGMLLd4pb46", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wGY5okP5yop8LH8F4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:13:37"} {"_id": "wrMpbCfpTfmdM4FZb", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c :Class, s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iA3FsG4DJ4vw9ZdJ7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 22:36:54"} {"_id": "om9SKXQnxoiAi2beW", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, p : Person, g : Group | c->p->g in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\tall s, t : Person, c : Class | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p,q,r : Person | (p->q in Tutors or q->p in Tutors or q->r in Tutors or r->q in Tutors \n \t\t\t\t\t or r->p in Tutors or p->r in Tutors)\n \t\t\t\t\t\t implies (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "Ym8qxY3r2oHynGPvC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 20:46:57"} {"_id": "tM5c3jFgJ3EiEGdAA", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8xZ3SYPbjx9TdJCie", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 11:59:41"} {"_id": "Y8ZPbaEQj7A6TH8sQ", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tall p: Person | (p not in Teacher and p not in Student)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3jHqWrxWGgjxHu7oJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:31:35"} {"_id": "iKrWXMY7a73Z4uEFX", "cmd_i": 12, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "MP3QytD9wcA49HhzA", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 10:10:54"} {"_id": "hdtgLACLygJTN2WeN", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Teacher | some c:Class | p->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c:Class | t->c in Teaches implies one c\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qEYsZ6WqPubHpPfpt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-28 21:53:48"} {"_id": "3jHqWrxWGgjxHu7oJ", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pb65cuQSfSRnHAiBj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:28:34"} {"_id": "aGm2PwpNnjxdJunEP", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "Eg6SxJS8e59o3YQPA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-17 09:43:56"} {"_id": "hnDBXYrRPbav5szDm", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome p:Teacher,c:Class | p->c in 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\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iLREgtJLz68dhcM9M", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:48:11"} {"_id": "mtQmDTYr9EYCiYLMW", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3N2B67GgAy96Ydpz8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 21:11:40"} {"_id": "WTP4d5LnyGnJA9usr", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall t:Teacher | (some g:Group , c:Class | t->c in Teaches and c->g in Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9eQoEMoJNqkfgShPh", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 12:01:53"} {"_id": "9rBLXm2CWkyMv98AH", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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, t : Person | (t -> c not in Teaches) implies (all p : Person, g : Group | c -> p -> g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "itgwNDuKZBADwiJRR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:05:35"} {"_id": "CLffpZLEj3d9BdKdf", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n all x, y, z : Person | x->y in Tutors and y->z Tutors implies z in Teacher\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 19:12:04"} {"_id": "mpi4uSgPgXJxt9d7E", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student|some t:Teacher, g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n\npred inv12 {\n\tall t:Teacher , s:Student | some g:Group ,c:Class| t->c in Teaches and c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1:Person, p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class , t:Teacher, s:Student, g:Group|(t->c in Teaches and c->s->g in Groups) implies t->s in Tutors\n}\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bpkbn5xhrREXDyaWv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:43:56"} {"_id": "NEEweseJeXuAueNXe", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class,t:Teacher | s in c.Groups.Group\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "BZbfFrMvTFDTtMkxk", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-12-2 11:45:08"} {"_id": "euSPp889R4RJhepbf", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XyjntChqGfpWidyLc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:28:16"} {"_id": "QybxSMTjPundbwvJi", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \t\n \n \t\n \tall t:Teacher | some c:Class,g:Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "XHsgSFZprraFv2AAn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:28:24"} {"_id": "rZAGcwkp5yS55WmPa", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher, y : Class | some z : Group | y->x->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uXekGetG6pEgBpiB6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 13:23:06"} {"_id": "Q7piQzpGuw3g9DmXd", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n \t\n \t\n \n all c:Class | some t:Teacher | some c.Groups implies some t in c.Groups.Group\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "CM2DLMaxK8x85sLjT", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 11:51:50"} {"_id": "Td9oHbgvtD3nSbXJs", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DxqMfpaxj3bnwDp2X", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 17:35:44"} {"_id": "ieqPE5pkZzYHg7XsM", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \n \t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tall c:Class, t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LcjYY9pLzqJAnCcwb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-2 15:46:39"} {"_id": "4zgQT38n4FWjZ9no5", "cmd_i": 6, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class, some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8rZNp88H7iTZaiwm4", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-30 22:03:15"} {"_id": "dXojDJJX8RoGdLdFR", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class,g:Group|some t:Teacher | t->c in Teaches and c.Groups.g \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "iwx8RMvhCTsioE9Qw", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 11:34:21"} {"_id": "XWXmizg9hzirJqS3t", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "N4AiTEwstWhMRLmbK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:37:22"} {"_id": "e6xbgdErqrJQcFfoy", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XnTAjRtTSKGNeKdzN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 09:13:34"} {"_id": "DBBnu8C8khZo3cosh", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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/* 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BFJNKaeqeh7KsXMWh", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 10:54:31"} {"_id": "hBhKsyDG3GYgCDcCh", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y in Student | y in Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "55Xn2tumbfb6yCnyM", "msg": "There are 3 possible tokens that can appear here:\n, : =", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:35:22"} {"_id": "JSjHRj8yRw9Dahz3a", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some s.(c.Groups) implies some t:Teacher | t->c in Teaches and t in s.~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "JbAC5xj7JNY9dWW7i", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-12-2 11:42:45"} {"_id": "Sj2CDFe3zMFni6HQC", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n \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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t :Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ohKZuGTBYkFjNWsWd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:53:53"} {"_id": "beKQ6tQdzZtJRgeKd", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EaS3LtLiqorJYTE5g", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:37:14"} {"_id": "w4Lmu65N746pt4s6j", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "ninrh7hSDxHxEYnHc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 13:13:37"} {"_id": "5myjcPjM43efNfDAg", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7nLpyqxLDZnM8DaXr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 13:18:51"} {"_id": "gG8xXezwXTTQeDYq6", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cDwnNkzQX89gxMaRP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:39:55"} {"_id": "5h7bN85vRNCv8d5E6", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LxPeD7htqrpYhRXEN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 17:19:50"} {"_id": "QrrGyaL6tSty8GqdY", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c : Class | some p : Person, g : Group | c->t->g in Groups implies c->t in Teaches \n}\n\n \n\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wzPv6srx2MwvKhKZq", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-3 00:18:06"} {"_id": "chEvxt5Ny5ojCAtyF", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Person | some c : Class, g : Group | c->p->g in Groups implies p->c in Teaches\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hziqLZR4viFsaWtgF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:46:24"} {"_id": "TGhkJL7WgujGLPYya", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 \t\n \tall t:Teacher | lone t.Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hbkWdAn74LR2EWZ6J", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:27:18"} {"_id": "GbvkGGivCyXvWEAQh", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n \tall p : Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n\npred inv5 {\n\t\n}\n\npred teaches_class[t : Teacher, c : Class] {\n \tt->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | (some c : Class | teaches_class[t,c])\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "c5NJt2KNJ26vqg37u", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:32:17"} {"_id": "rjva8b5tpkdWeZ8up", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rNPvpat99nYyjhHEG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-30 21:57:14"} {"_id": "XrxErehXvAS9SiDGg", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class,g:Group | some t:Teacher | c->t->g in Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "ATndwpvXGNMJG7MLv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:58:00"} {"_id": "ip94Rr9vX84krb93e", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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) iff not (Person in Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cQhXusHYPYBYi3rvP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 21:26:31"} {"_id": "k4avT8z9Y5QXfDjgd", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some s : Student, g : Group | c->s->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bgRTiiNu83L7oxL3W", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:46:26"} {"_id": "HEwWyL7FrEz9DvBaP", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n \n all c:Class,s:Student,t:Teacher, g:Group| some s.(c.Groups)->g and some t.(c.Groups)->g implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "gMDWKYACvAhXvvAB9", "original": "YH3ANm7Y5Qe5dSYem", "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": 222, "y": 199}, "Class1": {"x": 444, "y": 199}, "Class2": {"x": 666, "y": 199}, "Group0": {"x": 222, "y": 298.5}, "Group1": {"x": 444, "y": 298.5}, "Group2": {"x": 666, "y": 298.5}, "Person": {"x": 444, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "this/Teacher:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "this/Student:Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "this/Teacher:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}]}}, "time": "2019-11-11 15:00:51"} {"_id": "dfGGaDqaz2bqSAE9y", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-2 15:20:47"} {"_id": "aCnirAsoZxTQiN2vX", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "pxBv7LqdA7qh4idiy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 15:49:09"} {"_id": "MMLgDzyHP8AGJDg7k", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bKZsXYHoEPv7Y2Dgu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 14:43:22"} {"_id": "KCcSHyPszhwaxACv8", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, t:Teacher , s:Student| some g:Group | t->c in Teaches implies c->s->g in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YM8wayiHB4KnSosLs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:21:56"} {"_id": "ZTCSu3Z379NLqSrES", "cmd_i": 6, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Teacher | some c:Class | p->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8DkFZp6PbRHm2Zfti", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-28 21:50:17"} {"_id": "pubNbepzj6t7MQeED", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Teacher in Teacher.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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ACDKwTKmknRPKLmZ3", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 17:29:35"} {"_id": "c5ickXkZfKqQn3nNL", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\tall c:Class,g:Group | some t:Teacher | some (c.Groups).g implies c->t->g in Groups\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "6DvsLNJT4Z2xzdMDw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:09:29"} {"_id": "oiTEyFT7Kd6m4JumD", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n \n all c:Class,s:Student,t:Teacher, g:Group| some s.(c.Groups)->g and some t.(c.Groups)->g implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "CcEDvwzNfrfDRRk5x", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 21:19:31"} {"_id": "pT4nCWtWeQtWnretE", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | one Teacher in Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tTeacher.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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yySYgobbHPy5pq8JH", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:43:19"} {"_id": "q8DDFA74k5Q9XLB4B", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CFed7Ge8KcxTBooAh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:08:38"} {"_id": "uAXCQjuaTkeTcATW4", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class,g:Group | some t:Teacher | lone c->t->g in Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "XrxErehXvAS9SiDGg", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 11:58:09"} {"_id": "cpkkrX4khtttoqpKn", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | c in t.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\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 | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some p:Person | c->p->Group in Groups implies p in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pD7KXz2xkfK2XyWb8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-21 16:54:48"} {"_id": "f3wesMziizf3ShMWv", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class|some t:Teacher | t->c in Teaches and one s.(c.Groups) and one t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "gsNtHg3tLLeiemFK4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:39:43"} {"_id": "XdznEciNrBPygzRAN", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\t\n\n\n\tall c:Class | some c.Groups.Group\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "J8mCXG6nzR6xEfvFi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:14:23"} {"_id": "zjst9h3Y53xe6FqEK", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class | all y : Student | x->y in Group \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZsdemDEWAFwhgEGc6", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person}\nRight type = {this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:38:00"} {"_id": "F8EwsBKvWhzCfw3MN", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class| some t:Teacher | some c.Groups implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "TXhgCM9pjTR9eAP4t", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:02:17"} {"_id": "BDxm9WubTiE7aeppY", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c : Class | some p : Person, g : Group | c->p->g in Groups implies some t : Teacher | t->c in Teaches \n}\n\n\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DaFq9E76oiL5HLXYs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-3 00:21:38"} {"_id": "zLMxJGT5R4fYhkYQA", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AwQ5TpThjMZeyL6A5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 11:14:45"} {"_id": "DASz5fkr8nLFvHcdY", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher,some c:Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wBf348Z7w7MJ26cfg", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-2 15:29:29"} {"_id": "EcZdGbbtF7KiTjyuH", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "327ED2m5XDqp8RQhh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:25:34"} {"_id": "oz3TGdSbzenq3g8yM", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student,t:Teacher | some s.(c.Groups) and t->c in Teaches implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "APkz6S2up3BNDjtkB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 14:54:51"} {"_id": "TLYBNju9icsSBhoHW", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9NhkD8fnYGfK4BoY5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 11:47:24"} {"_id": "QAYoMzRqJXB2B6Jus", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tTeacher in Person.^~Teaches and Student in Person.^Teaches\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5g2izPG98NyuhkZv6", "msg": "^ ~ (this/Person <: Teaches) is redundant since its domain and range are disjoint: {this/Class->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 21:13:13"} {"_id": "trabLBBTuqWJ6jtwY", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hKoXZsNrCb4Am6CoP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 10:45:52"} {"_id": "GekKTySShNcSDqzzT", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iPDLgy6rgNd6fiuoo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 14:38:49"} {"_id": "tmm8hwthDQRm38h3y", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Person | some c : Class, g : Group | c->p->g in Groups and some q : Person | q->c in Teaches and q->p in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NP7SXTTM5CP8GHAK4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:51:39"} {"_id": "d8zh8rggMFFLBrTMh", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall t : Teacher | some x,y : Class | t->x in teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BdoexS2DqnqkqTwr6", "msg": "The name \"teaches\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 20:30:51"} {"_id": "SRukYumSZct7wFcQZ", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some g : Group, c : Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tmNgNNaCfgMomSRJm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-3 00:25:47"} {"_id": "EHGAwbAXRJgh4bpzw", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class,g:Group|some t:Teacher | some s.(c.Groups)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "wPwem6HEnp29J54P5", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:35:18"} {"_id": "SS5P47J2qcYic6r3F", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Tv9uFE3pLGY47Qqn9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:28:46"} {"_id": "Kk7NCmJGdsZByLcRM", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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, c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Hoerdvm886PQjFo8Z", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-1 17:58:30"} {"_id": "m79xnhkPdy8CzEY5z", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oJ2p3MeYczn3WEGG9", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:21:46"} {"_id": "8SopgjWR74WmW8cS2", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t :Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Qj7imk73m8c7JHyzh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:49:55"} {"_id": "EaS3LtLiqorJYTE5g", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7BdaW2WQopXbDy9x7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:36:57"} {"_id": "ZMx86nGRa9sSSdXXm", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlone Teacher 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EKseKKuEeHZvtt6T7", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 17:52:53"} {"_id": "wakyemK9BgHzChf3c", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall p:Person | some c: Class | p->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "opA7ZPLoJWeDTpL2s", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 10:43:47"} {"_id": "pukA5N5DX8pRD8nD9", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class| t1,t2:Teacher | some 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ejF43btrk3nEfFsZt", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-13 16:12:46"} {"_id": "Sxn2hFMqXKc7N3FQR", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n \tsome (Teacher 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WAGPHevmYHBuekgym", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 21:34:55"} {"_id": "4pMsmn7uEA6xyfqcT", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall t:Teacher,c:Class | t->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "amyg6pPDYcgDocX4R", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:17:31"} {"_id": "2nuFbPsxXtpx9HqJC", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3DmMBF84AhnbDQcWK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 21:09:00"} {"_id": "rRF5bR267Pb2qfynw", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9voekv7jMBjbFouKT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-10 16:40:07"} {"_id": "93LKhboWFDvvz6d6Y", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t all c : Class| some t : Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | some c1,c2 : Class | t->c1 and t->c2 implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8cLbDEBHnf2LdWFRB", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-9 00:09:24"} {"_id": "XyjntChqGfpWidyLc", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tt : Teacher | some c 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iNbDxfBsTGZYEMwwD", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:28:09"} {"_id": "JimdunE7Wmc636zPc", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "mm3MNqTuoCyXz3f4F", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-17 09:44:06"} {"_id": "9BGgQZ9Dmafv7phqt", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fJM9GbZyDmopCvWdx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:27:08"} {"_id": "NGXs87LpqQ4c2SWkj", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Person.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "uD9xxR7mynvsxfarX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 21:19:12"} {"_id": "cBfFYEWJEvH3Spbnq", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tTeacher in Person.~Tutors and Student in Person.Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rACCeQtuhD7wdiNfy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 21:14:07"} {"_id": "gwAedyQdFDjc7yJFC", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "98Ko83CkWFPWmHRQF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-30 18:46:18"} {"_id": "keR2DAtSE74BH5GaZ", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class | some s : Student, g : Group | c->s->g in Groups implies some t : Teacher | t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EJAg3NRdoZKfBon4A", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:18:24"} {"_id": "FLBQMvjBSWdmCJLNE", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* 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 p1:Person, p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QbXtSJYM992LmBw3c", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 17:08:52"} {"_id": "q3Dt94NkESwy7GCjX", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class | t->c in Teaches implies some p : Person, g : Group | c->p->g in Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cxxtNFe4o4zZGTw6w", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:17:41"} {"_id": "vENpG98RQ3Cf2aXYj", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CZo9KFSf7JyK4Kokb", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:15:52"} {"_id": "ygkEWbZEe4XAfbMDM", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "j8HXqZx8yaQnQQvMY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:19:56"} {"_id": "C8qKLjrWqLy6bG9Sa", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Person,c:Class | p in Teacher implies p->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "W7gyieMfKwgDZeXWt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-28 21:44:47"} {"_id": "327ED2m5XDqp8RQhh", "cmd_i": 1, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p in not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vWhtqeN254SsD8wgS", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-12-2 11:25:27"} {"_id": "ukDHMWTwzrvRuAodC", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher,c:Class,g:Class | (t->c in Teaches) implies (t->g not in Teaches)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,t:Teacher,g:Group,p:Person | c->p->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher, c:Class, s:Student | some g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AJNW8cRXBRvEGW9a2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 13:05:18"} {"_id": "bGqiZh5CaRkxmjgcH", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XZids7LBC4gsnArnh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:48:04"} {"_id": "9gLCDnfFhjtWWYnGZ", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | all s:Student | c->s 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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tYayPnks3cwFdthyF", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:14:40"} {"_id": "R2GPttJHgqkqDkNbC", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome c:Class | hasTeacher[c] \n}\npred hasTeacher[c:Class] {\n\tall g:Group | group_has_teacher[g]\n}\npred group_has_teacher[g:Group] {\n\tsome p:Person | p in Teacher and p in g\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "s75iEzifWZDhnWHzZ", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:34:05"} {"_id": "eMhKSQy7fYgmNfuvf", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\tall c : Class | lone 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8cgj6QoKHqYJJmRRE", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-10 18:03:51"} {"_id": "3PrvnJyvEqRdiHZo7", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rzxfotGaGBofjzPWA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 12:54:01"} {"_id": "knxGSSXcXQ7bRJ669", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n \tall p : Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | (some c : Class | t->c in Teaches)\n}\n\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | (some t : Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c : Class | has_groups[c] implies (some t : Teacher | t->c in Teaches)\n}\n\npred has_groups[c : Class] {\n \tsome s : Student, g : Group | c->s->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | (some c : Class, g : Group | c->t->g in Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JjFx8LMTv7YExYnHi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:46:44"} {"_id": "gLWyqRe3i8C3EHMSp", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall t : Teacher | some x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "d8zh8rggMFFLBrTMh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 20:31:01"} {"_id": "cxxtNFe4o4zZGTw6w", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | (some c : Class | t->c in Teaches) implies some p : Person, g : Group | c->p->g in Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qWGCvGX5SyskH4s9r", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 11:17:22"} {"_id": "M5sspa3euj2HbGdGr", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some t:Teacher,g:Group | c->t->g in Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "APZb9ZX4NBe92SBZ4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 21:01:13"} {"_id": "dFsbLuMJYbaTY5PGn", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, x, y : Teacher | y->c in Teaches and x->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cTxpXuesCKePd9okv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 17:37:13"} {"_id": "kt25K7yvj7q4EwM5T", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c :Class, s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WGjxrcDLCnJakisdP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 22:37:36"} {"_id": "3QdpLsNf2KAdt6smc", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher->Class in Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MQS9GDY3XLrgD65ZN", "msg": "This expression failed to be typechecked line 67, column 2, filename=/tmp/alloy_heredoc16381839241085644120.als", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 21:54:11"} {"_id": "juwxiXHxdsjZEziNi", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "f5qwMwwLKrCr64ZDy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 20:41:08"} {"_id": "v3SfYd6APRhx7yHiF", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall s:Student,t:Teacher | s!=t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p in Student or p in Teacher\n}\n\n/* There 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\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n all t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n \t\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 the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n \n\n}", "derivationOf": "vTacu7iG7Kd6NKW3W", "original": "YH3ANm7Y5Qe5dSYem", "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": "Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "Student:Person"}, {"parent": "Person", "type": "Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 177.60000000000002, "y": 238.79999999999998}, "Class1": {"x": 355.2, "y": 238.79999999999998}, "Class2": {"x": 532.8, "y": 238.79999999999998}, "Group0": {"x": 222, "y": 318.4}, "Group1": {"x": 444, "y": 318.4}, "Group2": {"x": 666, "y": 318.4}, "Person0": {"x": 710.4, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}]}}, "time": "2019-9-26 10:51:16"} {"_id": "wBf348Z7w7MJ26cfg", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iqCdLpJPghgYCGcnH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-2 15:28:28"} {"_id": "AmfTya7ffm3PXe6Yc", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5FtoEjXrQtgGTu65G", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 12:13:54"} {"_id": "EYpjtjGiTQQigj6C9", "cmd_i": 12, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \tall s:Student |no s in Person.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "i7ZYPCaCeAsqo8ABc", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 09:55:45"} {"_id": "sALpqgwLfqymCg4gr", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\t\n\n\n\t\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "TZbWNW4tq48oP8Sge", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:19:45"} {"_id": "FEuRNWYLncRMofS3A", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 \t\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gGdvA3BdJ5NGHZ3ef", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:23:06"} {"_id": "b9cDmZmbzxFk5Z5QT", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1,c2:Class | some t:Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KsXk8vfEPjPSNnKn7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:03:07"} {"_id": "G8tmQq4DwWTm3S3w4", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,t:Teacher,g:Group | lone t.(c.Groups.g)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "oAikYjAkrcMySBQTr", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is c . (this/Class <: Groups) . g (type = {this/Person})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 11:23:31"} {"_id": "riNaS3YcqyPKmENzi", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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\tall c:Class | some c.Groups.Group implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.^~Tutors in Teacher\n}", "derivationOf": "hY89vTSdwk8grJBP5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 11:53:16"} {"_id": "NgYD6snRXzmYMZjQh", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FaXJS56NrSap8dbzp", "msg": "The name \"g\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 11:33:37"} {"_id": "98j538CmvPdWLhNDg", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \tTeaches.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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mMLexmNeN4GHxZbqM", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 18:11:20"} {"_id": "NExh6WCuDXYMYvf4R", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x not in Student and x not in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tM5c3jFgJ3EiEGdAA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 12:00:04"} {"_id": "qupbKB7J7SKYQWvv5", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Zjq5y5FAzeN8d78eW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-10 18:08:17"} {"_id": "xkADZeG5CBH8La2sE", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zLMxJGT5R4fYhkYQA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 11:14:49"} {"_id": "3WCFjfy3fCt7G69XB", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "geXiD4vxL64Gvt9Ks", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 14:46:05"} {"_id": "bqeYDYzm9pTYbFWuy", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \n all c:Class | some t:Teacher | c->t 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eqmt5njHmAaRyfJSy", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Person}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 11:29:47"} {"_id": "eBXJdoHnNpAd7JMEf", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | some p : Person | p 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tKDrtbDfRMQ2hXx58", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:32:17"} {"_id": "k5kLHnCELBNyMxpk9", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tone Teacher in Teaches.Class \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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "937gR668u5MM8WvXk", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:51:45"} {"_id": "3p33LchHXuxaFCvPp", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher | some y : Class, z : Group, v : Person | x->y in Teaches and y->v->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n\npred inv14 {\n all x : Person, y : Class | (some z : Group | y->x->z in Groups) implies all u : Teacher | u->y in Teaches and u->x in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oiJvcoJ7RfNro8EDd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:41:16"} {"_id": "v7vWx6BuAXusK6rhQ", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n all x : Teacher | some y : Class | x->y 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "37g9XZjXKPqrBYTAT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 12:01:09"} {"_id": "88jkngenBbJnQtdda", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "N8LnqzeKRoFC8jFG5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 10:48:24"} {"_id": "u7Lqis8e4rZFheAtj", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | (some c : Class, g : Group | c->s->g in Groups) implies some t : Teacher | t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KXRYDybg7JoZDxejX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:08:52"} {"_id": "wnurApFDyLJAbfxa3", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "HZ3JiJtCbkfmaPji3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 10:17:47"} {"_id": "ZsdemDEWAFwhgEGc6", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class | all y : Student | x->y in Group \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PysQK6n4kZc4YKojc", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person}\nRight type = {this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:37:52"} {"_id": "YaYtoPoHBC2MD2RNk", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kBNBcqEW4SLNLYc5j", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-1 18:01:42"} {"_id": "4DmBDdJhWp2GyaEyp", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "YXi6wZP5TxwkC7a2t", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 15:49:23"} {"_id": "RvjkTnrFcBgrFhhxW", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | p in p.^~Tutors\n}", "derivationOf": "2s4hfd5JiDMbmqN3k", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-13 16:53:06"} {"_id": "DhxzoA3LcNXN56y96", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some p:Person,g:Group | c->p->g in Groups implies p in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "M5sspa3euj2HbGdGr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 21:10:51"} {"_id": "3j7ZXiZ4h92YoTxZo", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher,c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | ((t1->c 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tYdsFNf9R8unocBEJ", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:42:33"} {"_id": "qrRZMNP2cbJYA28PY", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mHRwmDtjgTZwv4hFx", "msg": "The name \"person\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:27:06"} {"_id": "3i4f37iLFu6zuT9Dg", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\t\n\n\n\t\n \n all c:Class,g:Group| some t:Teacher | some c.Groups.g\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "sALpqgwLfqymCg4gr", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:23:37"} {"_id": "PPpC5n8nkTqiFJxwG", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 all c : Class | all s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all t : Teacher | (t -> c not in Teaches) implies (all p : Person, g : Group | c -> p -> g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hPicTur8shgLc3eHZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:09:34"} {"_id": "hovj9vSW3GiRwqa8G", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Class | x in Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Person | x in Teacher implies x 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "v3QN2Jm3BDtrMzT7P", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:20:49"} {"_id": "zcRQ55GrG7pnNNMCE", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher,c:Class | some g:Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HhAj9y7kn4xCk96pY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 18:55:19"} {"_id": "szgvE2u9qXMhupKhZ", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher | t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "Q7uXP3hd2FqTRFSM9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 21:24:54"} {"_id": "bP3KPpMvsMywxs35r", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t.Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fvxxmh5GyFmFM4E5v", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-12-1 18:08:32"} {"_id": "TubcYWMWBX5Bej4AK", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall t:Teacher,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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4pMsmn7uEA6xyfqcT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:18:01"} {"_id": "q4c9et97o2XZG8ZNC", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MaZLtxYs66LN6r2et", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:47:17"} {"_id": "LicGAyrxorRADcD4o", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "NPu5KXvtDajEsJime", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-17 09:45:14"} {"_id": "WifFjpskvtkSFDTPT", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 all c : Class | all s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all t : Teacher | (t -> c not in Teaches) implies (all p : Person, g : Group | c -> p -> g not in Groups) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher, g : Group | ((c -> s -> g in Groups) and (t -> c in Teaches)) implies t -> s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZWDFaKM5w7JLmcDAM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:19:16"} {"_id": "JA8er95BKrH4Dfsjr", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\nall t : Teacher | some g : Group, c : Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\nall x,y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\nall s : Student | s in Class implies (some t : Teacher | t->s in Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TugsWqeFRkPikF686", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:36:56"} {"_id": "3DmMBF84AhnbDQcWK", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7gFPtSGJC6sA7g3MG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 21:00:01"} {"_id": "6DqNw27MspkFaqgCF", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\nall c : Class | some p : Person, g : Group | c->p->g in Groups implies p in Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yYFiwyztsaN2zGZw8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:17:27"} {"_id": "BjKxKRss7h7rhsm6D", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 all c : Class | all s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all t : Person | (t -> c not in Teaches) implies (all p : Person, g : Group | c -> p -> g not in Groups) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Person, c : Class, t : Person, g : Group | (c -> s -> g in Groups) and t -> c in Teaches implies t -> s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7tYjvuiox9TSAE7k6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:20:33"} {"_id": "nPWZuJRcbPmvbaELe", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KAWqDzcY492b7QHz6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 12:12:22"} {"_id": "udn2eLFt9uj2frS7k", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | c in t.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\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 | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some g:Group, t:Teacher,p:Person | c->p->g in Groups implies 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JSBjAprJQevFfiCzz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-21 18:07:13"} {"_id": "kZkTkwQoYcRNNuvfn", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class | some t : Teacher | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZkohNTkXcv3w9CGNr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 12:46:26"} {"_id": "CBx2xKpdkX5wcsM5w", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n \t\n \tall c:Class | some t:Teacher,g:Group | some c.Groups implies t in c->g in ~Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "Ek4SeDRiqgBHcpNgT", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Class->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 11:09:03"} {"_id": "wPKzFR9znk74n75CE", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | p : Person | p 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "arMqoTtSngKt83KwK", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:31:55"} {"_id": "eqmt5njHmAaRyfJSy", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ktyz5bnHyELE8KhMQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 11:28:31"} {"_id": "E9ftYmE7sxSY3PrZJ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some s : Student, g : Group | c->s->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "R6B89n589B4WFQFyJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:47:37"} {"_id": "hPstvNST6NsdJL2gr", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 21:27:51"} {"_id": "xmYfeTmaWFWXBeFdq", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FiAoFM9qSg3RCCfsW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-13 16:08:07"} {"_id": "kpcRgyBaf3ZZS9fPw", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tsome c : Class | Teacher->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "W78XrqNAdwrPEAQEh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-9 00:02:30"} {"_id": "ecEkuK4bjLvpS8mwr", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "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": "Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "Student:Person"}, {"parent": "Person", "type": "Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 177.60000000000002, "y": 238.79999999999998}, "Class1": {"x": 355.2, "y": 238.79999999999998}, "Class2": {"x": 532.8, "y": 238.79999999999998}, "Group0": {"x": 222, "y": 318.4}, "Group1": {"x": 444, "y": 318.4}, "Group2": {"x": 666, "y": 318.4}, "Person0": {"x": 710.4, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}]}}, "time": "2019-9-26 10:11:17"} {"_id": "xCEywwLB3WACzriMt", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "aAyMyeqjgcbc8qxBg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-13 17:04:27"} {"_id": "6Z4SWWTR2rRQfL5ib", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \t\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "q92BgPpxPC9HuhgHk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 18:07:02"} {"_id": "ZFcmAhND87gd7SSaj", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dGi2WdTLCj3o2tDzC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 12:59:14"} {"_id": "ah67RQZyRa8fn9kJJ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group | some c.Groups.g implies some t:Teacher | t->c in Teaches\n}\n\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "ckREaGh5mghFDZK8f", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-21 11:35:56"} {"_id": "tKDrtbDfRMQ2hXx58", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | some p : Person | p 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wPKzFR9znk74n75CE", "msg": "The name \"teacher\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:32:06"} {"_id": "zFWwW68hnmh2QzBa7", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall t:Teacher , s:Student | some g:Group ,c:Class| t->c in Teaches and c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student \n}\n\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2WG9gmhcrgMQ9nJhD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 23:22:57"} {"_id": "nMdZ9xBgzxMJFDJzZ", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fRMSr98bsC65nNGxv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 11:46:48"} {"_id": "GSYagt4bQWXQdqhtc", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n \t\n \tall c:Class | some t:Teacher,g:Group | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "CBx2xKpdkX5wcsM5w", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:09:13"} {"_id": "v246DEZPMv3j87v73", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n some c : Class | all s : Student, g : Group | c->s->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XHcpCYLGt5DoKxBLJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:42:04"} {"_id": "tMonpQ8fG7F3zr9RG", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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 g : Group, s : Person | c -> s -> g in Groups) implies some t : Teacher | t -> c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Person, c : Class, t : Person, g : Group | (c -> s -> g in Groups) and t -> c in Teaches implies t -> s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n all p1 : Person | p1 in Teacher or (some p2 : Teacher | p2 -> p1 in Tutors) or (some p2, p3 : Person | p2 -> p1 in Tutors and p3 -> p2 in Tutors and p3 in Teacher)\n}", "derivationOf": "LtpZ2TzYmLkWGAWrp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:41:34"} {"_id": "QpYRzDCgD8B9CwSjg", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NLhu58tu7ZamdMw9D", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:15:25"} {"_id": "J2uhZphH75N53kgu3", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t all c : Class| some t : Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2 : Teacher, c : Class | t1->c in Teaches implies t2->c not 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "edCabP7E286c3f2pL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-9 00:19:44"} {"_id": "HueKg36wscqJqnQ6i", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qeEk6GQQPwwyRMhSN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-29 16:25:02"} {"_id": "zfDs3xzK8dpvPnakd", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class , t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c,d:Class | t->c in Teaches and t->d in Teaches implies c=d\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 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\tall c : Class , t: Teacher | t->c in Teaches implies some p:Person , g: group | c->p->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "PoauyKHfY3eaThsAv", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:53:52"} {"_id": "2ESMznB6vtKgthap7", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c,d:Class | t->c and t->d implies c=d\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WLhf58X5Ms9AcpfmB", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:30:29"} {"_id": "AGZXByq6ZkSF9hFY8", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some c.Groups.s \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "bN9sw9jrvQRZXrzmo", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-13 17:02:09"} {"_id": "Xc38hveHDPZBrDi9h", "cmd_i": 10, "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \n \n \n \n \n all c:Class,g:Group,g:Group | some t:Teacher | ( c->s->g in Groups) implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3ChwqjB898fG2pxQJ", "msg": "The name \"s\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 11:38:52"} {"_id": "equXvcF27vEJzuc4k", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tDiPNkcqSpE4EkKKt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-9 00:02:58"} {"_id": "hPRKR3uB8CvyqEHxD", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class|some t:Teacher | t->c in Teaches and c.Groups.s \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "pNbXwZp3CERFjWj6j", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 11:33:20"} {"_id": "sZNXmMusXkhKFb8aM", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome p:Teacher,c:Class | p->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NpjFvAMDJaNH6KDXR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:38:52"} {"_id": "H6odbHQAzNs3chGK3", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RKaSaPKNtBE8daHkp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 12:54:12"} {"_id": "P8hy2oGL6d5uGaoFA", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "6T5CAG6gvn5pDTKGp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:39:15"} {"_id": "PyXaTvuQ6SN6TM9ut", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, g : Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NgYD6snRXzmYMZjQh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:33:43"} {"_id": "vRvdiJsB3FnmuEfa9", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "AAhkmh7bYSqT6rtLw", "original": "YH3ANm7Y5Qe5dSYem", "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": 296, "y": 199}, "Class1": {"x": 592, "y": 199}, "Group": {"x": 444, "y": 298.5}, "Person": {"x": 444, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "this/Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "this/Teacher:Person"}, {"color": "inherit", "type": "this/Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "this/Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "this/Student:Person", "visibility": false}]}}, "time": "2019-11-13 17:04:53"} {"_id": "c48sShnRF4rYNmG8r", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ogBLJhMeLgqXnQQnW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-2 15:31:59"} {"_id": "KozSnd3BffaNiXWTJ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t all c : Class| some t : Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n }\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some g : Group, t : Teacher | c->t->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3vzw5iDtRDJAfdRv6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-9 00:31:21"} {"_id": "JCtifQrucnTzhAXY9", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class , t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c,d:Class | t->c in Teaches and t->d in Teaches implies c=d\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 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\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 p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6Y7Zpve8xwprytXGq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:44:37"} {"_id": "gNdye2NkeAmJcG4Su", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 20:23:12"} {"_id": "tKm3W6iRapFFuE9BD", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | c in t.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\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 | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some g:Group, t:Teacher | c->Person->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bmSWkACMgrTCcL6ZG", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-21 18:05:56"} {"_id": "Tjsvm5uvENhF2ufwf", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \tall p, q : Person, c : Class | (some g : Group | c->p->g in Groups) and q->c in Teaches implies q->p in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tsome p,q,r : Person | ((p->q in Tutors or q->p in Tutors) and (q->r in Tutors or r->q in Tutors) and (p->r in Tutors or r->p in Tutors)) implies (p in Teacher or q in Teacher or r in Teacher) \n}", "derivationOf": "KfLZL8fLwNTnmHckh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 16:18:17"} {"_id": "u8QeGy8NEvZMc7Gpr", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \t\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "u3dt5JWh4YD4sAegg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 17:59:18"} {"_id": "MQS9GDY3XLrgD65ZN", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher->Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "q8YGsM7iMxTXkq4JW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 21:53:41"} {"_id": "mm3MNqTuoCyXz3f4F", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "a3mJCLLmTfd4YPJv7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-17 09:44:03"} {"_id": "pqHuS4EL3fma4LiLD", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8Hpq45iZG4HiteCfv", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 20:27:48"} {"_id": "7jNBffSXY49Y8Qd5R", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Person, c : Class, t : Person | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors \n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FiNn69ozg4kbGA6td", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 15:14:36"} {"_id": "qubnZKCtEyZh2wT7Y", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "a6qXYxEFHkLx5R4RR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-2 23:59:09"} {"_id": "rTZsw46aqbLPJpipp", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 13:06:50"} {"_id": "XjD9KC2qw3FWeNj4T", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | s in Class implies some t : Teacher | t->c in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XN7uzgnkyqM2a6zzM", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 21:06:43"} {"_id": "F8LSacSFvsgqJbQdm", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\talways (some t:Teacher | (all c:Class | t->c in Teaches))\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gNZzm2kWhAcyRbAMQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 21:50:02"} {"_id": "rppXtnpCMY9xknysp", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class |some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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\tall c:Class | some Person.(c.Groups) implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5GEGzspiQJmaXZhyL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:43:05"} {"_id": "v2T7GDsa2E5kkMaBG", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n some t1:Teacher , t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2 or (not t1->c and not t2->c)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Q2vKzFP89ZYSEBh5s", "msg": "This expression failed to be typechecked line 82, column 103, filename=/tmp/alloy_heredoc16452123166162457890.als", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:03:40"} {"_id": "bjoHZPpJhnc7hb5pi", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x is 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 11:58:46"} {"_id": "YyZDwdFNkp3F8ttvp", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \tClass.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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "98j538CmvPdWLhNDg", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 18:11:34"} {"_id": "zf2NMEgNpYzbGtqRk", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "5Q2sLCowpGuLsGP8m", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 21:20:11"} {"_id": "Xjue3AnKYT9Fjti8t", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\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\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pswGGhhzFbJSWhXF6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:41:40"} {"_id": "tsJaTaNNSuMox2ix8", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\n \t\n \tall c:Class,t:Teacher | t.Teaches.c\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\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n \t\n}", "derivationOf": "5WDrQt9vcTLLPWjLX", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 20:26:35"} {"_id": "MGYPEKxiEDPLqgLf6", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\tall c:Class,g:Group | some t:Teacher | some c.Groups \n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "JhPS8RzkGup9rB2Df", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:08:32"} {"_id": "KQFoqAZzRSzCZq8Kr", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Person | x in Teacher and x in Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nsome x : Person | x in Teacher and x 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kpRNtiZR45yjwYSmo", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:16:35"} {"_id": "C9eCQkS9RNSb943tq", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tsome c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sNfuSHurFQiERiaWd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 11:50:32"} {"_id": "iaTmQQ7XkxbXQWfF2", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bHMtaLNNABo9KDN6C", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-2 15:39:30"} {"_id": "wbp4bi7uXgCvF6pnN", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class, g: Group | some t: Teacher , p: Person | c->p->g in Groups implies (t->c in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | some g: Group, c: Class | (c->t->g in Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p:Person, p2: Person | p->p2 in Tutors implies (p in Teacher and p2 in Student)\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WhSydjxvsgZwpmTe3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-30 22:38:34"} {"_id": "NHZRa9cLPk2m2Q4GQ", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher,c:Class,g:Class | (t->c in Teaches) implies (t->g not in Teaches)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t=p\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,t:Teacher,g:Group,s:Student | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher, c:Class, s:Student | some g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RMmHKZ8gvt6uv5QRB", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:50:58"} {"_id": "KsXk8vfEPjPSNnKn7", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qQNJaytD44KpEwwcf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 15:00:43"} {"_id": "rxD6HL2rFjkzAuewD", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher, c:Class | (some g:Group | c->t->g in Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student \n}\n\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CftXM3aTXbbTt7oKm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 00:07:36"} {"_id": "G7Df25PJzjfSk7354", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jR8jZhbNst5qWkuid", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 09:51:07"} {"_id": "c4mpKsDKWeFRcQPwi", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "otqN7KCeE7y6dDC4N", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:37:13"} {"_id": "FdzZERH243rxkXbpf", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \n \t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tall c:Class, t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hCQEPLchZ29PrCn5Z", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-2 15:49:23"} {"_id": "5Q2sLCowpGuLsGP8m", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group, some c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "DJPw3q5BqgGhCXw4v", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 21:19:45"} {"_id": "meZDyaJsjCQxMYs9m", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student|some t:Teacher, g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n\npred inv12 {\n\tall t:Teacher , s:Student | some g:Group ,c:Class| t->c in Teaches and c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t:Teacher , s:Student | t in Tutors \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NDjjXwoqYZ6KKru8i", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:31:32"} {"_id": "P8uXkCKuoYikjWeXx", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \t\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\t\n \tall p:Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6Z4SWWTR2rRQfL5ib", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 18:07:50"} {"_id": "YoT7XzPQzDkE2xsEL", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "KrwXNJ8QMz9adeBrE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:37:33"} {"_id": "JTt3vBtZcNpHPvMmt", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hhtwpHrDotZPvPesd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-4 17:58:15"} {"_id": "CZo9KFSf7JyK4Kokb", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4sPprs8NHZGtKqyC3", "msg": "The name \"class\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:15:46"} {"_id": "gNSxFLDyk9YTJYoQ4", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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, v : Teacher | x->y->z in Group implies 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "92oM78Hyuh5v5rbmv", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 12:26:51"} {"_id": "SWK5cpWeeXtyLn4Fk", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c->t 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bytARck63kuZ55T5p", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Person}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:41:54"} {"_id": "nwr7HF6C2EPWoAiDF", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | c in t.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\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 | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | 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\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iSgxcL5btiimsF3nr", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-21 16:52:07"} {"_id": "3hCrWhq7G2HYFFT5a", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall t : Teacher | t not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2 : Teacher, c : Class | t1 -> c in Teaches and t2 -> c in Teaches implies t1 = t2\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}\n\n\n", "derivationOf": "gf5svrT7qgpxXC4Jg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-18 17:34:34"} {"_id": "nzDZeXD5wze6s2FET", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | one 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KeJoApuTJm6tMbskZ", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 18:03:40"} {"_id": "q8YGsM7iMxTXkq4JW", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "36N9qp6RgwMk5JjrN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 21:53:11"} {"_id": "Cyrri8e2wwRchwZPh", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PkkogoTnvHhXuPP7w", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-3 00:03:10"} {"_id": "kWZmKpJxgCZNawoF8", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Person,c:Class | p in Teacher implies p->c\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WZpYHspybnyZgYpwo", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:22:44"} {"_id": "wCeRiNNdRkY2tuaFt", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall p:Person, c:Class | (some t:Teacher, g:Group | c->p->g in Groups implies t->c in Teaches \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student \n}\n\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hm6n7Psd6X5XFP2iA", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 00:05:17"} {"_id": "opwKS7wyCrS3ACkQr", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n all c:Class,s:Student,t:Teacher|some g:Group| c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "CtpJqyp6wbeJJwoo7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 13:00:48"} {"_id": "hn83iDziKK864Wrpo", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tYzN8x83YJa8XkGXa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 10:50:45"} {"_id": "Cep6gTFiKon4C7CKH", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\nall t : Teacher | some g : Group, c : Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8o5zGk5D9vSEQ4BqK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:28:00"} {"_id": "JA2o5NvTSTXfxSrir", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5WLPJfHuR934tHFd7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 09:44:26"} {"_id": "WGjxrcDLCnJakisdP", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c :Class, s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wrMpbCfpTfmdM4FZb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 22:37:21"} {"_id": "F7xeQrqHZNdJoJJjr", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "hibtBe6QWbcq8zvLx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 10:17:43"} {"_id": "MyDtiicX52L2nYSem", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uhvYTdv2nsQ7BJEE3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-30 22:07:09"} {"_id": "HhAj9y7kn4xCk96pY", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,g:Group,t:Teacher | c->t->g in Groups implies t->c in Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zX5MGppcNMctsgqnt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 18:53:16"} {"_id": "hTSL9Ry6Q4CactvGW", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,g:Group | some p:Person | c->p->g in Groups implies p in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "DhxzoA3LcNXN56y96", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 21:11:27"} {"_id": "Yu6CFMN7coGhgWZee", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student,t:Teacher,g:Groups | c->s->g in Groups and c->t->g in Groups\n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "TFtywMFg2aj8bGvNo", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person->this/Class->this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 12:59:46"} {"_id": "KcEucXcwkKExWyjLR", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | s in Class implies some t : Teacher, c : Class | t->s in Tutors and t->c in Teaches\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cqKm24HB9cvWsu9Hv", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:21:56"} {"_id": "tyrfpx3Qdi9gj8KD5", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8xfT9tBpSyrhMuShq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 10:27:49"} {"_id": "kpdpJm2iuoB4PtmGh", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "27ai2vcEZebdyjyCd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-30 18:29:15"} {"_id": "v27vWhsroSd2vahx5", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\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\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "qQKvYeBdP2pXaQscM", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:44:16"} {"_id": "hY89vTSdwk8grJBP5", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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\tall c:Class | some c.Groups.Group implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NR62BqTREnSs8AMAX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:52:43"} {"_id": "E2ucjXk8v4j9sm6PS", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \t\n \n \tGroup in Class.Groups.Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "wREfk8is4eTCotD9i", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:26:39"} {"_id": "W6vbicRpgQafj8e2P", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n some t1:Teacher , c:Class | t1->c in Teaches or not t1->c in Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NjPExvsP63cD4FwFP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:05:27"} {"_id": "iNbDxfBsTGZYEMwwD", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tt : Teacher | t implies some c 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BxBjcQ7FbK8ex6rus", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:27:52"} {"_id": "APZb9ZX4NBe92SBZ4", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall g:Group,c:Class | some t:Teacher | c->t->g in Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "Z4T5Qpf2iYu5QtnXz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 21:00:19"} {"_id": "PNoB44Kd42osb2tHz", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,g:Group,p:Person | some t:Teacher | c->t->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dy7gSh3MGZCQSEYx9", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 20:46:03"} {"_id": "EqTQdcJEvSvkDnZef", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \tall p, q : Person, c : Class | (some g : Group | c->p->g in Groups) and q->c in Teaches implies q->p in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tsome p,q,r : Person | (p->q in Tutors or q->p in Tutors) and (q->r in Tutors or r->q in Tutors) implies (p in Teacher or q in Teacher or r in Teacher) \n}", "derivationOf": "wu6Fi3uvX8MjZLrZQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 16:14:18"} {"_id": "TWgj6HhjdpgtLsoZL", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class, g:Group | some c.Groups.g implies some 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "quL89W52WhpMgj8bm", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-30 18:43:14"} {"_id": "qrorThtSLXr9TCeCy", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome p:Teacher,c:Class | p->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher,g:Group | t->g in Groups\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rcNvX798N9Q2HKJ4G", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-28 21:37:30"} {"_id": "fEaBsSc2H9yt7ftep", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 13:29:31"} {"_id": "j9oM7kobNPMQtFo39", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\npred inv11 {\n all c:Class,g:Group | some c.Groups.g implies some t:Teacher | t->c in Teaches\n}\n\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "ah67RQZyRa8fn9kJJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-21 11:40:12"} {"_id": "BcwhDtze5qGgYJmoR", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | one c : Class | t->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qubnZKCtEyZh2wT7Y", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-3 00:00:36"} {"_id": "6t6frCgpYaHHfrrBd", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p: Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all t1:Teacher,t2:Teacher,c:Class| (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "f3xqyBCbDh9ZFmq2s", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:43:05"} {"_id": "bN9sw9jrvQRZXrzmo", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "Xh3kcrqCyeGJSaB3E", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-13 17:00:22"} {"_id": "cAua8P78P4SF5Ejy7", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall s:Student,t:Teacher | s!=t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "STmsyn6LJjfrkMv4L", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:28:05"} {"_id": "QdAnuxpLtoMfoA68M", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "h544eY2sf8cRumx5G", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 10:46:40"} {"_id": "aqhGcbJ6Yn6RrvR3W", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Person,c:Class,g:Group | p in Teacher implies c->p->g 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2pH86E6aAenpNX3ap", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:26:30"} {"_id": "YhJzRWeNYLm7utE97", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \t\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\t\n \t or p in Teacher\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LkSY5r92QdQWBNrJk", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:12:21"} {"_id": "L4cp5qG7dsH6Ftyzs", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher | some y : Class, z : Group, v : Person | x->y in Teaches and y->v->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n\npred inv14 {\n all x : Person, y : Class, v : Teacher | (some z : Group | y->x->z in Groups) and v->y in Teaches\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RdCA9xXXBKtJN5X6x", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:52:00"} {"_id": "MsfZ2Hk9Ncsh3e4Ps", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8Dx6SayGa4fNKZL3G", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:41:43"} {"_id": "TkgRuCrANF2P7btLv", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FRArH9kSkgvApSnJi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-4 18:02:48"} {"_id": "E99PX3GbhCGSrFppj", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Person | some c : Class, g : Group | c->p->g in Groups implies some t : Teacher | t->c in Teaches and t->p in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PiQeDju89iQC4QvS2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 15:39:56"} {"_id": "AAgmXi8qd5ERgJRz7", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "byEHtZmomM73PSHYG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-9 00:04:10"} {"_id": "xx8sqjBTqWMrPQ2n8", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c:Class, t:Teacher, g:Group | t->c not in Teaches implies c->t->g not in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QRo9Mkryt4nWqnrnL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 17:51:27"} {"_id": "upxrAqf9QZYxNsiGC", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\t\n \tall c:Class,g:Group |some p:Person,t:Teacher | p->g in c.Groups implies p in c.~Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "6RHRjmiEtrJNqw2JA", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 17:16:12"} {"_id": "vypAAk7ME9mSdQeqM", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Person | some c : Class, g : Group | c->p->g in Groups and some q : Person | q->c in Teaches implies q->p in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TMhDqwFWMkcSaLpM6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:49:26"} {"_id": "zLQ2xKKgvNdd4D2nM", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | Teacher->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "98G2ZBqGzSfnNyEAD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-9 00:00:33"} {"_id": "BxNJpotECXdLPhmJf", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dfGGaDqaz2bqSAE9y", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-2 15:21:01"} {"_id": "LB4dJQAtLP3SJLtCw", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JHbPzWTWvpjCyRQxX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 17:35:19"} {"_id": "6TEEmBKSofeQ3xMKN", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p: Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oSbkrWznkEbCySy8H", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:16:26"} {"_id": "fWb5PMixrw8e4BE9z", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EcZdGbbtF7KiTjyuH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:25:42"} {"_id": "ojqa6pMWsp24CdnRF", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1,c2:Class,t:Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c:Class,t:Teacher ,g:Group | t->c not in Teaches implies c->t->g not in Groups\n \t\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fkFBuH79avq9n6JJP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:23:33"} {"_id": "Resz4TfGywkpQjGn9", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\tno 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GABJ4Nvn4GbjskA4d", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 17:56:00"} {"_id": "MQKyRdCxLTejLJBCp", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TD7t5GhN5HqYQ55TH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 10:31:33"} {"_id": "PqLeegvPmJ3njf3WB", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\t\n\n\n\tall c:Class | some c.Groups.Person \n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "5Mw6uLqHS9Xqhu6Hi", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:16:01"} {"_id": "hJFobmjKtcPdF5guY", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JEcY2z2xbXNPWAtWk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-30 18:39:45"} {"_id": "ooF3ahKJhAAhTZbk4", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n \t\n \tall c:Class | some t:Teacher | some c.Groups implies c in t.Teaches \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "cBqBJ6x2CeRvrhYYX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 11:50:13"} {"_id": "iENzjbNKbzf2w5mo5", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bzRSRJYjfghFXtn37", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-10 17:37:28"} {"_id": "XRtzx49dFv3oQSLZJ", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tTeacher in Person.^~Tutors and Student in Person.^Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cBfFYEWJEvH3Spbnq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 21:14:18"} {"_id": "mjgsuLkf3GcJHw3yJ", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \tTeacher.Teaches in Class.~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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eX5AeqkhaiCjohtgR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-4 18:44:07"} {"_id": "w326BMSimEq5JydD2", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class , 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PsBWjBBP2KEhdud3w", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-1 18:12:21"} {"_id": "y46SQDaW5mP2Kid87", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n \t\n \tall c:Class | some t:Teacher | some c.Groups implies c in t.Teaches \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "M63qsmLmQHbKEiatB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:30:17"} {"_id": "6RHRjmiEtrJNqw2JA", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\t\n \tall c:Class,g:Group |some p:Person,t:Teacher | p->g in c.Groups implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "gZCDLXs8WZFbz4mEo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 17:15:17"} {"_id": "QiHdEjnNxoRsjznnx", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t0, t1 : Teacher | some c : Class, g : Group | c->t0->g in Groups implies t1->c in Teaches\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JuTYXKhCHhhyrSjDq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:23:47"} {"_id": "EqQ35KJ7EagNn3yoj", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, x, y : Teacher | y->c in Teaches and x->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dFsbLuMJYbaTY5PGn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 17:37:16"} {"_id": "2Nnx2KDzAFQMx5qPr", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or P in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FxijjJzaPtm88hrPX", "msg": "The name \"P\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:08:44"} {"_id": "JHgB7KJyRrh2uMmJQ", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | all s:Student , g:Group | s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yXBYto6xPtjXXExxS", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:11:37"} {"_id": "MbAYmTyRwjgGixyz6", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wHPpBGFhLvnSNc74n", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-12-2 11:27:41"} {"_id": "hbkWdAn74LR2EWZ6J", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 \tall c:Class | lone Teaches.c\n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NDFRxmWcyi7T4G3c5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:26:35"} {"_id": "bptLcjkFLSY672KMH", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tTeacher.Teaches\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "okP6ofShHnif7ZRq3", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 18:27:33"} {"_id": "FkpwyGfXMWbBeHxtv", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class, g: Group, s: Student | some t: Teacher | c->s->g in Groups implies t->c in Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5S8TksufjA3eih6Zx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-30 22:24:09"} {"_id": "emAr2t4JWLgGXz6us", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student iff p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HueKg36wscqJqnQ6i", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-29 16:25:43"} {"_id": "XhPSFjENesEQXEcHX", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,t:Teacher,c:Class,g:Group | (t->s in Tutors and c->s->g in Groups) implies t->c in Teaches \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:06:22"} {"_id": "NR62BqTREnSs8AMAX", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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\tall c:Class | some c.Groups.Group implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8aQpeLvvhRCJ22CEx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:51:50"} {"_id": "dkY3CKR7MZsZEd5Gy", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RCrEYn4bJvpsp7K2j", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:26:52"} {"_id": "QB7nmEzhCzczgZ3B6", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class , 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "y96jH95jqHP4gzNai", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-1 18:11:36"} {"_id": "zuA22HTRWxq6RPHim", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | no some Teacher in Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "68qBaJKzRPZWq2ZbH", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:44:13"} {"_id": "kFM5ccHPN7d6334Mf", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | s in c.Groups.Group\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "JSjHRj8yRw9Dahz3a", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-12-2 11:43:13"} {"_id": "XN7uzgnkyqM2a6zzM", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, g : Group | c->t->g in Groups and t->c in Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some c : Class, g : Group | c->s->g in Groups implies some t : Teacher | t->c in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GhF8S6setsYudFreY", "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": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:05:19"} {"_id": "6pc8nsR5yYL4xQmLL", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n \tall p:Person | p not in Teacher \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | some t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}\n \n\n \n/*LINK: http:", "derivationOf": "X5tTsb5wfWrPNYHFu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-28 17:08:58"} {"_id": "c42Awxudygp9sKTWd", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s,t : Person, c : Class | (some g : Group | c->s->g in Groups) and t->s in Tutors implies t->c in Teaches\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p,q,r : Person | (p->q in Tutors or q->p in Tutors or q->r in Tutors or r->q in Tutors \n \t\t\t\t\t or r->p in Tutors or p->r in Tutors)\n \t\t\t\t\t\t and (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "TpjCjfcmux7SqvSZi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 20:38:22"} {"_id": "wKEdAXQ2EvLzkPHJX", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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. */\n\npred inv11 {\n \n all g:Group, c:Class | some p:Person | c->p->g in Groups implies p in Teacher\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Ha99DPFqxqzvx8A2v", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 14:30:39"} {"_id": "vBD5MjKoyMen5qkz2", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TQGrFwJA8BYNYNwtJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-29 16:58:06"} {"_id": "HrjX9W2Q7FaSc8ZkS", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\t\n\n\n\tall c:Class| some p:Person | some c.Groups.p \n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "GRszCL4i9xC9aTKmG", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:18:45"} {"_id": "KAWqDzcY492b7QHz6", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kim8JKBhDBFsgpRPH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 12:12:03"} {"_id": "vzAr2iWYX3CidkRnu", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \tno Class.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9zrkJS9rfeoeDrQNq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-4 18:11:56"} {"_id": "4YkSm4uiRyJv4BRQ5", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall p : Student | some c : Class, g : Group | c->p->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ejY4mpr6EyL6wTfhv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 20:35:32"} {"_id": "dqEq2uTYqyCGKCWHd", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:26:14"} {"_id": "SGzdXYhpsFWrbcqRX", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:20:41"} {"_id": "BB7TFQF7S6cJJZJMb", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WmXY34nY5See78o2v", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:53:21"} {"_id": "pbkGEZhPpCeY5Mewh", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class , 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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t Person.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "H8pcqsoK7zkJvMKgL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-1 18:29:30"} {"_id": "rZqjE6zMHHq9KkouT", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Tutor | t in p.^~Tutors \n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "msg": "The name \"Tutor\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 09:50:12"} {"_id": "fRMSr98bsC65nNGxv", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XaLsoRDWscSNMJBXB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 11:46:28"} {"_id": "iv7G8hFaEB6f3rgdG", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, g : Group, t0 : Teacher | c->t->g in Groups and t0->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6KAQbJY5oXaaWjNqW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:36:58"} {"_id": "CF9XCmFNQdYqXWcNf", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 { \n\tall p : Student | some c : Class, g : Group | c->p->g in Groups implies some t : Teacher | t->p in Tutors and t->c in Teaches\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BEFEkqGuePxhqyKJT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:44:35"} {"_id": "NASeP4fCrs99Xwx3S", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class, s:Student, g: Group | some t: Teacher | (c->t not in Teaches) implies c->s->g not in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AetQ2br2fNxxY7r7T", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Person}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-30 22:16:22"} {"_id": "C7JZ4we6w42LQTJtA", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8ksjuyEGWD978pJu8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 20:25:14"} {"_id": "kkxCxJ86Paytcm9zZ", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c :Class, s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cD23ad3p3TWmPjrQ3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 22:34:01"} {"_id": "BEv3jmM9hSfRmcr5t", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n \tall p:Person | p not in Teacher \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | some c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "i3toD76dnHGYPBDdw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-28 16:58:47"} {"_id": "HjkMZd7zAsNzaJrRn", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GqjJiPzZL9EytfhBu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 12:11:01"} {"_id": "zoaqSgaLm9jZ88WYj", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Fsqm4AKyRuPLPGajh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 12:01:57"} {"_id": "6nG5jSupXZTbeBE3r", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student|some t:Teacher, g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher , s:Student | some g:Group ,c:Class| t->c in Teaches and c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8msmxSsYBxPHmFxLn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:28:48"} {"_id": "W6zWGcGpwphWKFmbd", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | (c : Class, g : Group | c->s->g in Groups) implies some t : Teacher | t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nzmQyEK4WHCh7Kivw", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 21:08:31"} {"_id": "v3QN2Jm3BDtrMzT7P", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x,y : Class | x->y in Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Person | x in Teacher implies x 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qu2ebYg9hMXhAPpDb", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Class}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:19:18"} {"_id": "KwgiJu8WBuNrgPwpf", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZdSi9gBiqPM9gCGKJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 11:10:26"} {"_id": "s2Q833e9k4WeAG9LR", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher | some y : Class, z : Group, v : Person | x->y in Teaches and y->v->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n\npred inv14 {\n all x : Person, y : Class, v : Teacher | (some z : Group | y->x->z in Groups) and v->y in Teaches implies v->x in Tutor\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RMntYrERY2vncb6QG", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 15:44:17"} {"_id": "JQxLyh77dw53sgsHm", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student | s in (c.Groups).Group \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "bGLxziXBQpRzCvG5S", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-30 18:56:15"} {"_id": "MYxB5o4jPfDBQKar4", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student|some t:Teacher, g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n\npred inv12 {\n\tall t:Teacher , s:Student | some g:Group ,c:Class| t->c in Teaches and c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1:Person, p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "weQ5BdhaBEM2Q6zxN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 15:37:39"} {"_id": "wBT4ZRaeiFosvCfsq", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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 all c.Class | some t:Teacher | some c.Groups implies 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\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "WhvKKFvH8q8sCXpaS", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 12:52:05"} {"_id": "QPPMGT5iDXEqCnc5D", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student,t:Teacher |some g:Group| some s.(c.Groups)->g and some t.(c.Groups)->g and t->c in Teaches implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "g3opyETPoAE6LqyLr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 14:58:23"} {"_id": "WrNLc5HNGDeSWcmqQ", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\t~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XnBykCMrhu2fyb5GC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-10 18:41:37"} {"_id": "X8Z3FGy6LtCSTeq5J", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student|some t:Teacher, g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n\npred inv12 {\n\tall t:Teacher , s:Student | some g:Group ,c:Class| t->c in Teaches and c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1:Person, p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class , t:Teacher, s:Student, g:Group|(c->s->g in Groups and t->c in Teaches) implies t->c in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MYxB5o4jPfDBQKar4", "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": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:39:43"} {"_id": "hSwusMJF56mKy9psv", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-10 14:49:48"} {"_id": "Aoga73g9HnpXavzvQ", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "AGZXByq6ZkSF9hFY8", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-13 17:02:23"} {"_id": "LtpZ2TzYmLkWGAWrp", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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 g : Group, s : Person | c -> s -> g in Groups) implies some t : Teacher | t -> c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Person, c : Class, t : Person, g : Group | (c -> s -> g in Groups) and t -> c in Teaches implies t -> s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | aux1[p]\n}\n\npred aux1[p : Person] {\n p in Teacher or (all p2 : Person | p2 -> p in Tutors and aux1[p2])\n}", "derivationOf": "FYHwoa2YADXE8MLZm", "msg": "pred this/aux1 cannot call itself recursively!", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:39:09"} {"_id": "rG6MaK6uQYrcoDSWa", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "w6BP5mKiwN9pjkNrG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:48:25"} {"_id": "9eQoEMoJNqkfgShPh", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall t:Teacher | (some g:Group , c:Class | t->c->g in Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jsc9GnPAE6DXKMBHS", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person->this/Class->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 12:01:22"} {"_id": "yXHqaCgyGfim9NRJa", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "n47MBdA9YuMEhNjLb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 11:14:32"} {"_id": "PbHrTMywshm7spH3o", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "m6x5YSqoAezCdQiQJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:46:22"} {"_id": "qxbXqSx87i6iiEmJq", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\nall t : Teacher | some g : Group, c : Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\nall x,y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\nall s : Student | some t : Teacher, c : Class | t->s in Tutors implies s in Class and t in Class\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AcqLnDPjsPuvwENLg", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:41:00"} {"_id": "24ZCaPwM98ggGjtyE", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | some y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rg43vdKsmnp83Gdaq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:14:55"} {"_id": "oLdB8foP83xThJxtH", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qA3S7yDfHpewoKeMq", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:10:14"} {"_id": "fRSMF5fc9ugyYrKwM", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 09:39:55"} {"_id": "sZZCzF7qJ9t8itKdc", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, g : Group | c->t->g in Groups and t->c in Teaches\n}\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Cw4Tf4vSJeTXcm8WG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:39:46"} {"_id": "kauQ2JTxswrd62fbm", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4XyMmJNyEP4f7pn6N", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 13:08:12"} {"_id": "vyC99MsgpnNECSAS8", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\n \tall c:Class | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gk6GMC4JumL87ATWD", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 19:05:41"} {"_id": "cEH6dtdJQjRzrMQbK", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tno ~Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "Xp5YAcWB9HBeJ5NBg", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 10:21:16"} {"_id": "98Ko83CkWFPWmHRQF", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rjNKvQ5nFJQhkC42b", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-30 18:43:42"} {"_id": "N8LnqzeKRoFC8jFG5", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Teaches\n}", "derivationOf": "78imGwkM9fj5TkDkr", "msg": "^ ~ (this/Person <: Teaches) is redundant since its domain and range are disjoint: {this/Class->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 10:48:06"} {"_id": "gjn7ycQkjz88wTkXN", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2e6x6PpkuFgCWvBFi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 17:27:24"} {"_id": "GE9Bjshn4cFP7Hdxg", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tNZBCDYjos9j4WtRi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 12:35:11"} {"_id": "YyBCY4dEc4NRs6L85", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Person | some c : Class, g : Group | c->p->g in Groups implies some q : Person | q->p in Tutors and q->c in Teaches\n \n \t\n\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ib5g9FmL84oxzGhM3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:56:39"} {"_id": "dGi2WdTLCj3o2tDzC", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | ((some g : Group | c->s->g in Groups) and t->c in Teaches) implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "47mSNNvLEuXZ3hut2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 12:56:55"} {"_id": "q6JWWe9apTHYE8zTJ", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class, g: Group, s: Student | some t: Teacher | c->s->g in Groups implies (t->c in Teaches and t != s)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | some g: Group, c: Class | (c->t->g in Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t: Teacher, s: Student | t->s in Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3qMjv9p3ZXCJyY6if", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-30 22:34:01"} {"_id": "6a7m4JvXxWKeq7FDx", "cmd_i": 3, "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall p: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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8HS6Y7HQxcTajafeG", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 10:45:31"} {"_id": "FDZWWpTRmBZD3r73Z", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p,q,r : Person (p->q in Tutors or q->p in Tutors or q->r in Tutors or r->q in Tutors \n \t\t\t\t\t or r->p in Tutors or p->r in Tutors)\n \t\t\t\t\t\t implies (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "qBCQsGXf2RDvykRFu", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 20:30:12"} {"_id": "3xwirdoANQYQKfrMh", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, g : Group | t->c in Teaches and c->t->g in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wkm2TqDN9FSf8j2tk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 20:58:49"} {"_id": "8vgdo7EPWMCEtQp9j", "cmd_i": 10, "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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. */\n\npred inv11 {\n \n all c:Class, g:Group | some p:Person | p->g in Groups implies p in Teacher \n \n\t\n \n \n \n \n \n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ofEQk6nSwywWW5brQ", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 14:27:38"} {"_id": "MfjWHaXND2jdiENNL", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s, t : Person, c : Class | (some g : Group | c->s->g in Groups) and t->s in Teaches implies t->c in Tutors\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p,q,r : Person | (p->q in Tutors or q->p in Tutors or q->r in Tutors or r->q in Tutors \n \t\t\t\t\t or r->p in Tutors or p->r in Tutors)\n \t\t\t\t\t\t and (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "c42Awxudygp9sKTWd", "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": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 20:39:36"} {"_id": "SMCXsdfK8ELLKR5vh", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n Teacher in Teacher.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4MEpzH4YKSHqj5Kcr", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 17:23:35"} {"_id": "odrsnEBkzgEwpZQB4", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:25:57"} {"_id": "E93urmFcYDhzp9YyD", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BC4oL3KRCZTdcp2zZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 17:38:52"} {"_id": "5g2izPG98NyuhkZv6", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mtQmDTYr9EYCiYLMW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 21:12:10"} {"_id": "E8wrYWGQy7kyNCFSk", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | one t : Teacher | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8cBCYQnqktk9Pafuo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-3 00:07:03"} {"_id": "nm6FP4mqXKLiJQZpr", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher,c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | ((t1->c 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "f2ajKFurbQA2t4pB3", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:40:47"} {"_id": "WMFmC8y5iyF2dko2y", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "a3CXmRkv7WndowDd3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:43:26"} {"_id": "G8exR2S7mD8X8qsuo", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:24:10"} {"_id": "n8QEzNqBtvhZ4PgPz", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t all c : Class| some t : Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tt1,t2 : Teacher | some c : Class | t1->c and t2->c implies t1=t2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6Y9F3vWEZgYNckR2H", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-9 00:05:51"} {"_id": "Ym8qxY3r2oHynGPvC", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, p : Person, g : Group | c->p->g in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\tall s, t : Person, c : Class | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p,q,r : Person | (p->q in Tutors or q->p in Tutors or q->r in Tutors or r->q in Tutors \n \t\t\t\t\t or r->p in Tutors or p->r in Tutors)\n \t\t\t\t\t\t implies (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "7tT63rBPiD6ToF7wP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 20:44:57"} {"_id": "TBBJdYoaykP6JkP9d", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Teacher & Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3RFEqGTPsWJLwT8nE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-10 16:44:17"} {"_id": "JEcY2z2xbXNPWAtWk", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jT9NYPLjTt8GtcnJA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-30 18:35:35"} {"_id": "YaZNx3Z26uxSeXaid", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall p1, p2:Person | (isTutored [p1] implies p1 in Student and p1 not in Teacher) and (isTutor [p2] implies p2 in Teacher and p2 not in Student)\n}\n\npred isTutored (p1:Person){\n\tsome p2:Person | p2->p1 in Tutors\n}\n \npred isTutor (p1:Person){\n\tsome p2:Person | p1->p2 in Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "78NNqyzMvYX8bd3RH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 18:11:37"} {"_id": "BaqmEfFs5SuGeaHQ4", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t :Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1 : Teacher, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yYXTN6k7acyBE7Hde", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:44:09"} {"_id": "dGhtfzTh2wp4N4NBF", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t all c : Class| some t : Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n }\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some g : Group, t : Teacher | c->t->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EtfFAe6NSD5YWd6w9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-9 00:29:37"} {"_id": "Cvjt9j36SEprtqdiH", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\tall c : Class | t1, t2 : Teacher | t1 in Teaches.c & t2 in Teaches.c -> 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gpCpo5Btj9vPNLLgM", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 18:06:11"} {"_id": "y3rQ9YtAbNQEgugwv", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tall s:Student | s not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fMBwvstYiwyZ5S8bp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:23:34"} {"_id": "yYXTN6k7acyBE7Hde", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t :Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Dg9QgA8rfTqrP3q2K", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:42:07"} {"_id": "n47MBdA9YuMEhNjLb", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "x4QvWmo9BC8vPGjHG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 11:14:30"} {"_id": "SPoNbGoXJukjRhy7T", "cmd_i": 6, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all t : Teacher | c : Class | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hjGW5QTdLWAFz7pZR", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 17:34:33"} {"_id": "Xnn39m6QQopZoSrbT", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There 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\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher,c:Class,g:Class | (t->c in Teaches) implies (t->g not 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "B5bLBudfnck65sjXc", "msg": "The name \"teaches\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:28:39"} {"_id": "CtpJqyp6wbeJJwoo7", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n all c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "qsZ5wEkMgiKvzshAZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 13:00:18"} {"_id": "822ks3ZAxTwJPaWjt", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some t : Teacher | some s : Student | some g : Group | c->s->g in Groups and 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NoYwxYP77eYeqyALL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:23:02"} {"_id": "FWXeGRAkMSgJGSCzt", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 09:15:56"} {"_id": "6tguwSDAwkhgJLmj8", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "9M6ewWznfpmKgvuiQ", "original": "YH3ANm7Y5Qe5dSYem", "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": 222, "y": 199}, "Class1": {"x": 444, "y": 199}, "Class2": {"x": 666, "y": 199}, "Group0": {"x": 222, "y": 298.5}, "Group1": {"x": 444, "y": 298.5}, "Group2": {"x": 666, "y": 298.5}, "Person": {"x": 444, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "this/Teacher:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "this/Student:Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "this/Teacher:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}]}}, "time": "2019-10-12 21:29:37"} {"_id": "oR6r63Kue5Siaw3GP", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerosn 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "msg": "The name \"Perosn\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 20:58:43"} {"_id": "Sc9CeTBtw5QSqhWqj", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5A5FAcQ79maWsAH97", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 12:14:06"} {"_id": "rjT8DucpTFeYSizGb", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,t:Teacher,g:Group | c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "G8tmQq4DwWTm3S3w4", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 11:23:42"} {"_id": "JDcnnLwDmdJYYRffW", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\n \t\n \tall c:Class,t:Teacher | c.~Teaches.t\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\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n \t\n}", "derivationOf": "2vdKpi3oaCPcopaWi", "msg": "This cannot be a legal relational join where\nleft hand side is c . ~ (this/Person <: Teaches) (type = {this/Person})\nright hand side is t (type = {this/Person})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 20:25:17"} {"_id": "zWczZtoc2aZTRJJna", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gG8xXezwXTTQeDYq6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:40:02"} {"_id": "WMoQGHQRCm4K2dwc6", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hRuyawMYprhWxQXJf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:40:40"} {"_id": "BgMFSawMqBu4SqT9L", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 t1->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gH6HeahgoTEY7WLpm", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 10:31:18"} {"_id": "8GxyRjTsQbiAn7z5P", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n all x, y, z : Person | x->y in Tutors and y->z in Tutors implies z in Teacher\n}", "derivationOf": "JCbaCgvPtNGCqCy9c", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 19:12:33"} {"_id": "xs5RmWFmf8wCqMkF2", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class | one 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "w4Lmu65N746pt4s6j", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 13:13:45"} {"_id": "tZEG4743xJKgXja6N", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher, c : Class, g : Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ojEeWqGDwBx4tabj7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:32:27"} {"_id": "oH7J3PLxGFaKmvYLH", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class |some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YMJbTmgDcSd5szLCb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:40:02"} {"_id": "HzauHXE2nQCG5P2X6", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher | some y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "45Cs8QoXcwTvmKfre", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:31:08"} {"_id": "hqQkmWFquyxwYeoRS", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \tno Person.Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "77CMZw3zPPQMJbjH3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:54:43"} {"_id": "naH4xwBYuJMAm3Phb", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, p : Person, g : Group | c->p->g in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\tall s, t : Person, c : Class | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p,q,r : Person | (p->q in Tutors implies p in Teacher or q->p in Tutors or q->r in Tutors or r->q in Tutors \n \t\t\t\t\t or r->p in Tutors or p->r in Tutors)\n \t\t\t\t\t\t implies (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "Mh3siMjJnictGyo3S", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 20:51:03"} {"_id": "YTRYCcfKoXNckGdc7", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YyJa2kBDCA4JLhZLq", "msg": "The name \"teaches\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 23:57:02"} {"_id": "57ZKEEazrkqAn7A9R", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | one t.Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "a2kocdTbgNebBcnAj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:34:07"} {"_id": "YEiMsu9i83Mcpm7TD", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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 Person.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "BBmYLBhJrD8kiQmpa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 21:17:02"} {"_id": "a6qXYxEFHkLx5R4RR", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tWLTuPfppaA6hszsS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-2 23:59:04"} {"_id": "nME4Ki8cqH3yvkBes", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some c.~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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KLRAXo4gg7LZLKu8i", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 10:28:51"} {"_id": "uk9MDQgLPRbhTFT8K", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\n \t\n \tall c:Class,t:Teacher | lone t->c in Teaches \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n \t\n}", "derivationOf": "xRNKYsbKEZZx9Mvov", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 20:23:51"} {"_id": "A2xqCdq2PLnCHGmiA", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "wnurApFDyLJAbfxa3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 10:17:49"} {"_id": "gbHNSCkMGDB48SxJP", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t:Teacher | lone t.Teaches\n ~(Teaches<:Teaches).(Teaches<:Teaches) in iden\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zv29u76eui9bpc745", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:44:44"} {"_id": "Svfcc2wNApZY8XiGF", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tno ~(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "fAciRcHWJGwBWPkbJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:23:19"} {"_id": "k39vM8LaoiPH2HKRS", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nthPkzYSNXsaghmXP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 12:11:21"} {"_id": "r3ejDkoWHygLaJAwc", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall g:Group | some t:Teacher | t in Class.Groups.Group\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "Y3hMMEnsudcWW4pHe", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 14:47:37"} {"_id": "NC8cnbR86Jq9zYjgr", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Student | x 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WB7MSNWZhzCj2gQbe", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:40:49"} {"_id": "6theGPJk4Y5udJ2He", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \tsome c : Class | (some p : Person, g : Group | c->p->g in Groups) implies all t : Teacher | t->c in Teaches\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "unaJpmz82tMoZCC72", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 20:57:26"} {"_id": "H4kZeiHczhsSpm5JN", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2F5bYFF7jQ9Mo66um", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-1 17:47:24"} {"_id": "qYm5uWaQ5gy3KQ3Ja", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some p : Person, g : Group | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "juwxiXHxdsjZEziNi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 20:41:22"} {"_id": "6BLMHnMPtdNkjufdQ", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sF8TQNvQSnhb9AH3a", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:18:43"} {"_id": "5HWMGbrqbhshiBjvp", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \tall p, q : Person, c : Class | (some g : Group | c->p->g in Groups) and q->c in Teaches implies q->p in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p,q,r : Person | p->q in Tutors and q->r in Tutors implies (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "WZxzimvrNvkXZakHz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 16:03:39"} {"_id": "edvHabFnajYDGYya2", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class | some g : Group | c->s->g in Groups) implies some t : Teacher | t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hqC48fvKYSKZEoYH6", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 21:11:35"} {"_id": "w6BP5mKiwN9pjkNrG", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sYnf2rd2ZGDLBjKDZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:47:56"} {"_id": "JaYv9bemiKvTWvcFa", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\tall p:Person | some Teaches.c\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gEqm42ZxKdqf4P9Fh", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 11:24:23"} {"_id": "fLjQ9T22Qo8EMxctx", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\t\n all c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "Ry4ncT9QHtTecGj9y", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-21 10:57:13"} {"_id": "tKMiP59Ntcghs9fvr", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n \t\n \tall c:Class | some t:Teacher | some c.Groups implies c in t.Teaches \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tno Groups.Group\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "nx6nwxujqppeKTdbT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:25:30"} {"_id": "cf72ZcjKoeMD7kuK7", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "gKoYt9kCTA6QauLiC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-13 17:03:18"} {"_id": "LYtGuBx5Nw2mZesBf", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 s:Student | s 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:15:53"} {"_id": "KrcBHtebvda52Nykm", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n some t1:Teacher , t2:Teacher , c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LYd35G9nXzE25vLYo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 14:58:32"} {"_id": "f3xqyBCbDh9ZFmq2s", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p: Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all t1:Teacher,t2:Teacher,c:Class| (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rfToPyGrra3MB3sAy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:42:09"} {"_id": "PteDGa3sxgqKDuiNm", "cmd_i": 12, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall p1:Person | (isTutored [p1] implies p1 in Student\n}\n\npred isTutored (p1:Person){\n\tsome p2:Person | p2->p1 in Tutors\n}\n \n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rSrYDejMD4NE8dNrB", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-7 18:09:49"} {"_id": "sfBD9JxoNdB4gQbDY", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class, p : Person | some g : Group | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9PqKsvgJDmFSGhmsR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 20:39:28"} {"_id": "bk7km6ARAb9p6wbzA", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Person | x in Teacher and x in Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Person | x in Teacher implies x 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KQFoqAZzRSzCZq8Kr", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:16:53"} {"_id": "BaevqBH3Ya4BZg5AK", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LYtGuBx5Nw2mZesBf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:17:15"} {"_id": "FbvFpmWh7EgDzoXrn", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 in Student\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gbq5PByBkDtbKQex7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 21:16:47"} {"_id": "9hGKji4iLKcu6HfR4", "cmd_i": 11, "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student | all g:Group |some t:Teacher| c->s->g in Groups implies t->c in Teaches\n \n \n \n \n \n all c:Class,g:Group,s:Student | some t:Teacher | ( c->s->g in Groups) implies t->c in Teaches\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t:Teacher | all c:Classes |some g:Group | t->c->g in Teaches\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yQRcW3cdeqTEDeCtC", "msg": "The name \"Classes\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 14:10:09"} {"_id": "PdsPsmGNwFoyWRTtb", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HzauHXE2nQCG5P2X6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:31:37"} {"_id": "sHnoxFyWqpE4hqLjq", "cmd_i": 12, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall p1:Person | isTutored [p1] implies p1 in Student\n}\n\npred isTutored (p1:Person){\n\tsome p2:Person | p1->p2 in Tutors\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3vmXpLbjcDAoDupGP", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-7 18:07:25"} {"_id": "JHZsCRAvydiajNXgW", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vWe337Nc5sQQA59vT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 10:28:14"} {"_id": "CbCEKJv6S84nx82QA", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, g : Group | t->c in Teaches implies c->t->g in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KPyJjpjvvJJq2Y6Fr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 20:58:19"} {"_id": "DHpPesE6Sz3RAxw8t", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Nziqm9DjMznP5sFp8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:26:09"} {"_id": "Hqyi9RNivjNj2Jdsr", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\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 \tall t:Teacher | some t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7mQa4xnNiQrbaiBTm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-12-2 11:30:30"} {"_id": "oEHDqyGhwMrySxzee", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t all c : Class| some t : Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n }\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TQhrJWa9XdejafxEF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-9 00:21:31"} {"_id": "HZ3JiJtCbkfmaPji3", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "F7xeQrqHZNdJoJJjr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 10:17:45"} {"_id": "LPWykSzMrK4PdA5zN", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class|some t:Teacher | t->c in Teaches and one s.(c.Groups) and one t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "oSHta7SBAY7kkfRwh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:36:57"} {"_id": "annJMvvX48KMGPXry", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XJkDT7ucFL6P4rMFw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 14:56:49"} {"_id": "P5ZGGAzFbXxq3n6mX", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Person | some c : Class, g : Group | c->p->g in Groups implies some t->p in Tutors and t : Teacher | t->c in Teaches\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cZ8Yr458p2qKN6dND", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 15:43:22"} {"_id": "AiyFGTK5q9fka2uqb", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\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\tsome c : Class | (some p : Person, some g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BECnhma7FtkSsKd6F", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 20:40:47"} {"_id": "3y4Wc7F4WscBYaGNz", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n \n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Jf2wo86HLQRkbcnWR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 10:45:39"} {"_id": "8rZNp88H7iTZaiwm4", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3EEs5aZNhGozBy4BB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-30 22:01:26"} {"_id": "trqCQfrGG64sjHbhe", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wHrRkERMeydbLeED6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-10 14:51:37"} {"_id": "zBLJrLiJua8oWzS2n", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ukzhyTu4Ypmwo6Jdn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-4 18:01:23"} {"_id": "CYfijaEatPxomcxPz", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4j5BwoHqps8kSTTPE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 10:34:35"} {"_id": "K9SiRx5Htwd4NYdqW", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class , y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall x : Class | some y : Teacher | some g : Group | x->y->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yM5CwetcQt6TEixFo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:44:14"} {"_id": "cBqBJ6x2CeRvrhYYX", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n \t\n \tall c:Class | some t:Teacher | some c.Groups implies c in t.Teaches \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "GTdapbD6DYua3sxhL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:31:29"} {"_id": "fJM9GbZyDmopCvWdx", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xFnpyKxDL8EXXbDQA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:26:39"} {"_id": "wREfk8is4eTCotD9i", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \t\n \n \tno Class.Groups.Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "nvamxsEas8vzvF7K5", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:26:16"} {"_id": "EYYXquJyzkcJ64qeZ", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher,c:Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SD6BN4doypndh3kRX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-28 21:40:48"} {"_id": "ACQxqSDqnzxnN6Bmw", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ENDZbcC2rqQp2MpjK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 12:53:57"} {"_id": "8xTjG8TaKsLWj96s4", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kauQ2JTxswrd62fbm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 13:08:26"} {"_id": "vQkgDyqdEzQ3Ys2rD", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\t\n\n\n\tall c:Class | some c.Groups\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "c5ickXkZfKqQn3nNL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:12:02"} {"_id": "BpApw2vse8j7tSfw3", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 23:33:53"} {"_id": "dCfMmY6KkdHHvjXYt", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | c in t.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\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 | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | s->Group in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Ycgc5h6cpNEqR34jj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-21 16:51:17"} {"_id": "5gap8mcSPDAHmsHpw", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "odYb9oHpmnhh9vHyk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:43:03"} {"_id": "jT9NYPLjTt8GtcnJA", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6hwPa7vQ2kxxtTxaC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-30 18:34:07"} {"_id": "YL8P6f5v7FadrKBKp", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NskmnLkuRmo4zETYk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 10:36:56"} {"_id": "7Qg7t6EMG6YLuvmjy", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n all c:Class,s:Student,t:Teacher,g:Group| c->s->g in Groups and c->t->g in Groups implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "4vc82bvC2MtCybyS8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 13:01:29"} {"_id": "BmyyypSoGkuLJr8XD", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class,g:Group |some t:Teacher | some c.Groups.Person implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "uouwHfEKM3rjbnTr7", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:02:54"} {"_id": "HzYSaNm8vuNCABRFc", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "v7v5KZrfZRYs6FnsP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:29:49"} {"_id": "WGWsZJKG7zJPiYffY", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->p->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Z6CjMSi9yw8Jg9NMT", "msg": "The name \"p\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 20:38:08"} {"_id": "CoHhu7G9Gs4qrkCqA", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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 all c:Class,g:Group | some p:Person,t:Teacher | c->p->g in Groups\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "hoMgKh9DokKJpDxpZ", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 12:49:09"} {"_id": "hX7dL6QYnPBxzr4d8", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yXHqaCgyGfim9NRJa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 11:14:36"} {"_id": "2JwPBTb4Z9fgAhYFW", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors \n}", "derivationOf": "ozKr2xJZTFXcc7E9w", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 09:56:33"} {"_id": "gj7Y4ugrZJmLmWnMz", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n \t\n \t\n \n all c:Class | some t:Teacher | some c.Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "Q7piQzpGuw3g9DmXd", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:52:05"} {"_id": "4PYuRyxdggckeojd6", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student | all g:Group | c->s->g in Groups implies some t:Teacher | t->c in Teaches\n \n \n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "k9QCvg5PtqFvMRKME", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 11:33:17"} {"_id": "As9ib7GtfyQZqGkdZ", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher, y : Class | some z : Group | y->x->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Tt8KMXkmWafyLmGqP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 14:55:14"} {"_id": "P7W9z9ffCubTWN2iF", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | p.Teaches.Teaches.Teaches implies p in Teacher\n}", "derivationOf": "KgeWW9KAZ2SvPdcv2", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 20:50:42"} {"_id": "NPu5KXvtDajEsJime", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "eEcet5DrdwLaaNAbp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-17 09:44:57"} {"_id": "otC2Dct5WsQv8aW28", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\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\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "M4waziYmD3HcG9WRM", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:45:17"} {"_id": "X5tTsb5wfWrPNYHFu", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n \tall p:Person | p not in Teacher \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | some c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}\n \n\n \n/*LINK: http:", "derivationOf": "JZnaJM4LYHSWZHRBG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-28 17:06:53"} {"_id": "bjwQrYf8ErjrM5bRL", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xif6vgybF2xirG6hB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 09:17:33"} {"_id": "PeMNv5krcpjmMuabf", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1,c2:Class,t:Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c:Class,t:Teacher,s:Student, g:Group | t->c in Teaches implies c->t->g in Groups\n \t\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some c:Class, g:Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SHHuCYRkX6L49qW37", "original": "YH3ANm7Y5Qe5dSYem", "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": "Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "Student:Person"}, {"parent": "Person", "type": "Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 666, "y": 132.66666666666666}, "Class1": {"x": 444, "y": 132.66666666666666}, "Class2": {"x": 177.60000000000002, "y": 265.3333333333333}, "Group0": {"x": 355.2, "y": 265.3333333333333}, "Group1": {"x": 532.8, "y": 265.3333333333333}, "Group2": {"x": 710.4, "y": 265.3333333333333}, "Person": {"x": 222, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}]}}, "time": "2019-10-2 15:29:36"} {"_id": "JEfCTWowuNtCx9bom", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Person.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all c:Class,s:Student,t:Teacher, g:Group| some s.(c.Groups)->g and some t.(c.Groups)->g implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "Mc8KtSNRnXKdhW7Bf", "original": "YH3ANm7Y5Qe5dSYem", "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": 222, "y": 199}, "Class1": {"x": 444, "y": 199}, "Class2": {"x": 666, "y": 199}, "Group0": {"x": 222, "y": 298.5}, "Group1": {"x": 444, "y": 298.5}, "Group2": {"x": 666, "y": 298.5}, "Person": {"x": 444, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "this/Teacher:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "this/Student:Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "this/Teacher:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}]}}, "time": "2019-11-11 21:19:46"} {"_id": "YM8wayiHB4KnSosLs", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , g:Group | all s:Student | g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YKfwyrkQ2Hd5gy6iB", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:19:11"} {"_id": "AcqLnDPjsPuvwENLg", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\nall t : Teacher | some g : Group, c : Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\nall x,y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\nall s : Student | some t : Teacher | t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JA8er95BKrH4Dfsjr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:39:20"} {"_id": "syCKjph8korj95zrf", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 all c : Class | all s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all t : Teacher | (t -> c not in Teaches) implies (all p : Person, g : Group | c -> p -> g not in Groups) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | t -> c in Teaches and (some g : Group | c -> s -> g in Groups) implies t -> s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CQeLs2vR3PJv947sY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:15:05"} {"_id": "oYZ9APKCMvDqsWPyS", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, p : Person, g : Group | c->p->g in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\tall s, t : Person, c : Class | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p,q,r : Person | (p->q in Tutors or q->p in Tutors or q->r in Tutors or r->q in Tutors \n \t\t\t\t\t or r->p in Tutors or p->r in Tutors)\n \t\t\t\t\t\t and (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "Fzji8TtquwfQBeZq5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 20:42:24"} {"_id": "55Xn2tumbfb6yCnyM", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y in Student | y in Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tYFduz6eYT5n8ByYj", "msg": "There are 3 possible tokens that can appear here:\n, : =", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:35:10"} {"_id": "2w8th3p4QkmqcssZE", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class 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 | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FXeaMEXhk7cMBzq9t", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:18:08"} {"_id": "NpcPCRWJTF5WkzQ6T", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class,g:Group |some t:Teacher | some c.Groups implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "C4A7Mh3BJFiYGjFLx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 11:00:32"} {"_id": "9byWDyHwsfHp3jp3T", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors \n}", "derivationOf": "enztAB4qWmTnemMGT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 09:55:52"} {"_id": "xuurti45NGztWSmdr", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n \t\n \tall 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "HJyt5uwbyt6Kn8dbB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:07:21"} {"_id": "4MEpzH4YKSHqj5Kcr", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RawvgojufaN5tvnXt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 17:22:56"} {"_id": "xj8fDZvYjDyX2PzQe", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class , y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nsome x : Class | some y : Person | some g : Group | x->y->g in Groups implies y in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5WMX3H6QQAPzbdfQ9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:48:08"} {"_id": "ATndwpvXGNMJG7MLv", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class | all rn: c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "mSFtAdnB9zAkwZYWB", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 11:56:26"} {"_id": "Lkhb2ThSWxJ3RSzEs", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WGWsZJKG7zJPiYffY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 20:38:15"} {"_id": "fJAZXTSdQzKDmetrh", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tall c : Class | some t : Teacher | t->c in Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uJiyPKz68WeLoXHeY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:27:37"} {"_id": "yN2z9Dwe4s5arp6cT", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1,c2:Class,t:Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c:Class|some t:Teacher, g:Group | t->c in Teaches implies c->t->g in Groups\n \t\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ojqa6pMWsp24CdnRF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:24:31"} {"_id": "J2etjqZTvRHiPA3uy", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "34scg9AZu7APgxaqT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 15:48:59"} {"_id": "FYHwoa2YADXE8MLZm", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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 g : Group, s : Person | c -> s -> g in Groups) implies some t : Teacher | t -> c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Person, c : Class, t : Person, g : Group | (c -> s -> g in Groups) and t -> c in Teaches implies t -> s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some p2 : Person | p -> p2 in Tutors and p in Teacher\n}", "derivationOf": "NzfW3iAp6FAXWRaCz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:35:34"} {"_id": "xzi4tB2NMQygBdCeZ", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "uqYb5owXYqTdjCE8j", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 20:55:45"} {"_id": "xym8daAemkG3XjJwR", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in Person.Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "LYfwwPGcfkAzj6TRk", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:19:25"} {"_id": "WT58vQo88GwPpgKB4", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CcHQjRCP4LnAivx88", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 12:12:44"} {"_id": "DYEK9fPkXSKCKy54R", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\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 \tClass 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Hqyi9RNivjNj2Jdsr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-12-2 11:30:52"} {"_id": "ypHR73gfJi7zZ4xQ5", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sL8gzbTQi7obpBow5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 10:30:34"} {"_id": "kYAdjfcbrDyzTquTQ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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, t, s : Person, g : Group | (t -> c not in Teaches) implies c -> s -> g not in Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Person, c : Class, t : Person, g : Group | (c -> s -> g in Groups) and t -> c in Teaches implies t -> s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n some p1, p2, p3 : Person | p1 -> p2 in Tutors and p2 -> p3 in Tutors and p1 in Teacher\n \n}", "derivationOf": "B2tFD8rrn6hHmwT8P", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:24:20"} {"_id": "WfxQGFEBsLA3c6Aiw", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bjwQrYf8ErjrM5bRL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:18:21"} {"_id": "hhtggh7bsuWvtdoPY", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class, s:Student, g: Group | some t: Teachers | (c->t not in Teaches) implies c->s->g not in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ppmLmry2rzrGmuuks", "msg": "The name \"Teachers\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-30 22:15:37"} {"_id": "J8mCXG6nzR6xEfvFi", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\t\n\n\n\tall c:Class | some c.Groups.Person\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "GtP2YzagDbhqmdWyT", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:13:41"} {"_id": "f2ajKFurbQA2t4pB3", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher,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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iuWkzbctN9Tzfx4ZA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:37:28"} {"_id": "2FyYRF79QiN6FkS7u", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rgxhhEeNpQBrkN6wE", "original": "YH3ANm7Y5Qe5dSYem", "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": "Int"}], "metaSubsetSigs": []}, "nodePositions": {"Class0": {"x": 666, "y": 132.66666666666666}, "Class1": {"x": 444, "y": 132.66666666666666}, "Class2": {"x": 177.60000000000002, "y": 265.3333333333333}, "Group0": {"x": 355.2, "y": 265.3333333333333}, "Group1": {"x": 532.8, "y": 265.3333333333333}, "Group2": {"x": 710.4, "y": 265.3333333333333}, "Person": {"x": 222, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}]}}, "time": "2019-10-2 11:19:14"} {"_id": "2rG9QemTAbxz6odyR", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | c in t.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\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 | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some g:Group, t:Teacher,p:Person | c->p->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wLuQ5mJ7ipgjsGTdP", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-21 18:06:20"} {"_id": "vcJmzinmrgfXvzPSP", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | t1,t2:Teacher | c->t1 in Teaches and c->t2 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RGS5uGbDXoWxy7La9", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 10:30:19"} {"_id": "nRpTAPs8Eav2igfjM", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some t : Teacher | t->p in Tutors or (some q : Person | q->p in Tutors and t->q in tutors)\n}", "derivationOf": "GCeDxwdYf3vBzqM46", "msg": "The name \"tutors\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 05:51:36"} {"_id": "Yk3Fo2YyvBCF8b3ok", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1,c2:Class,t:Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c:Class|some t:Teacher, g:Group | t->c in Teaches implies c->t->g in Groups\n \t\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9BxbrMyvNoqufYEGF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:25:36"} {"_id": "2TCRjHyEktM7LpmQz", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wfpuhhWZhdFGSzW6J", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-13 16:11:18"} {"_id": "SrzsFToHXJcG889Xe", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bMC8QorYw5GWkjfdP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-1 10:01:46"} {"_id": "xRNKYsbKEZZx9Mvov", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\n \tall t:Teacher | lone ~Teaches.t\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\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n \t\n}", "derivationOf": "xv7ru7ZtreEfhg6in", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-4 20:21:40"} {"_id": "38fCFXa6LGrQRkrDB", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p: Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n all t : Teacher| aaa[t]\n}\n\npred aaa[t:Teacher]{\n some c: Class | t->c\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dtvJ94zXaaR4mJuB6", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:22:16"} {"_id": "5zobFWoWh3tRuXuLy", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rmBRg9r6CRQ5AJivx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-1 17:49:50"} {"_id": "fzbwBZ3jzjfNqfKgH", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher | some y : Class, z : Group, v : Person | x->y in Teaches and y->v->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n\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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "J8NjJqCHgctWCFdto", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 15:55:25"} {"_id": "m6TNohrCHu3ZKX2DH", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Student | some t:Teacher | t in s.^Tutors\n}", "derivationOf": "JRRXNh42z5meZbYRv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:48:46"} {"_id": "mtyhENLnwRt4fYQux", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "w7zmpqgSXPvWPAks3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:46:51"} {"_id": "937gR668u5MM8WvXk", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tone Teacher in Teacher.Teaches \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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "457KoMKuyRjDcpRC9", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:50:30"} {"_id": "4SA2ZtkaZ35wHFB3q", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bjoHZPpJhnc7hb5pi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 11:59:01"} {"_id": "RCrEYn4bJvpsp7K2j", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p in Teacher or in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Rj6ApYwXueBupgQnA", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-12-2 11:26:46"} {"_id": "KfLZL8fLwNTnmHckh", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \tall p, q : Person, c : Class | (some g : Group | c->p->g in Groups) and q->c in Teaches implies q->p in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tsome p,q,r : Person | ((p->q in Tutors and q->r in Tutors) or (q->r in Tutors and r->p in Tutors) or (p->r in Tutors and r->p in Tutors)) implies (p in Teacher or q in Teacher or r in Teacher) \n}", "derivationOf": "xoPDuyBsh6YNjossN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 16:17:38"} {"_id": "cDwnNkzQX89gxMaRP", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | some t : Teacher | t->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fPWW6ENx8XFkR9T4F", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:38:14"} {"_id": "WtpYmrhsNTfS5Hzof", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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\tall c:Class | some Person.(c.Groups) implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "svn8qdQwJg2r3RaJt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 13:21:55"} {"_id": "DEyGmWrcs54Z6upYL", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n \t\n \t\n \n all c:Class | p:Class.Person | some c.Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "gj7Y4ugrZJmLmWnMz", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 11:53:31"} {"_id": "nEggBtd3iKeCfWS8u", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \tno Person.^Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "hqQkmWFquyxwYeoRS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:55:14"} {"_id": "R6B89n589B4WFQFyJ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some s : Student, g : Group, t : Teacher | c->s->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jLNL5wk5GmdqAno5F", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:47:13"} {"_id": "PQjXeC2eCtEh3LJpy", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "H2KMqm3RYFJviH2ez", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:39:23"} {"_id": "afLNss3dyniMd5ngY", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8AEJmmcEjBpnhA3Dm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-21 16:42:27"} {"_id": "qCbRh5mAGqEj5RAji", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p: Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | t->c , c: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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FqBJuMygYA3ANSAsW", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:30:54"} {"_id": "9DTwRMA8yEk6ZPPZa", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\n \t\n \tall c:Class,t:Teacher | lone c.~Teaches.t\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\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n \t\n}", "derivationOf": "uk9MDQgLPRbhTFT8K", "msg": "This cannot be a legal relational join where\nleft hand side is c . ~ (this/Person <: Teaches) (type = {this/Person})\nright hand side is t (type = {this/Person})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 20:24:39"} {"_id": "NrAjgAxAdDmxTtwEJ", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n}\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\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "t4bJK5ZG6TryiQk99", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:34:18"} {"_id": "XaLsoRDWscSNMJBXB", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "w3AuYgruGRvsmuy6Y", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 11:46:18"} {"_id": "tE2Yu6rigpZq56Mro", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches \n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "T2vt7AfiXFK29xNGE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 17:30:11"} {"_id": "nZunicDH9WTfeYtQg", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\t\n\n\n\t\n \n \n \n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \tsome Groups.Group\n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "NhYi9RaHT3GMHBnXr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:27:01"} {"_id": "EPmfBjhGQdg8zGCSm", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher, y : Class, z : Group | y->x->z in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aeKHRQz2h5rmbJr5G", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 12:32:31"} {"_id": "BkT5h3hSGcm3toupd", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "W9BAaKSxejvz674bD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:22:41"} {"_id": "GQu7MYPFnsdSvCgBE", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "YmPaaJbtAu4xoiMmr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:17:58"} {"_id": "PsBWjBBP2KEhdud3w", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class , 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QB7nmEzhCzczgZ3B6", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-12-1 18:12:08"} {"_id": "kSCCc4krFGvixZ8sq", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tMaJQBBApd28TJ5Yy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 10:12:09"} {"_id": "bHcHFSxhYXzPiYvRA", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\nall t : Teacher | some g : Group, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6DqNw27MspkFaqgCF", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 11:27:41"} {"_id": "gPdwcSjHjgQuBqLqp", "cmd_i": 10, "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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. */\n\npred inv11 {\n \n all g:Group | some p:Person | p->g in Groups \n \n\t\n \n \n \n \n \n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8vgdo7EPWMCEtQp9j", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 14:27:56"} {"_id": "cZK5nNqvcN5oxxzCw", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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\tall c:Class | some Person.(c.Groups) implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "4bwJ9auugBoRwgihE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 13:22:59"} {"_id": "vGAMyoTzsuak7GdHq", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class| some t:Teacher | some c.~Groups implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "F8EwsBKvWhzCfw3MN", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 12:02:59"} {"_id": "rzbxdCjpxw6BuaY2B", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "66grxBoFzSu5HfJ7h", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:22:26"} {"_id": "YHagd289iHEZnYr2K", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "beKQ6tQdzZtJRgeKd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:37:33"} {"_id": "nisvvnhsnnsNK2tj4", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tClass 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YHvMMpJShvGYv5GHa", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-3 10:14:59"} {"_id": "s8BCMWGr77yGgxNhT", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher | some y : Class, z : Group, v : Person | x->y in Teaches and y->v->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oDpDBHjCDCk65gR6d", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 15:36:11"} {"_id": "PzXTgfQnRxWSM9m4N", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 all c : Class | all s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all t : Teacher | (t -> c not in Teaches) implies (all p : Person, g : Group | c -> p -> g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3d6Yrd4RJKRciArTX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:10:07"} {"_id": "He4Yxz4v6rgdgwMDQ", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "v7LNcKkuFApr2dJac", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 22:04:02"} {"_id": "8B9FFYjiPeZZXp3vw", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JTt3vBtZcNpHPvMmt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-4 17:58:28"} {"_id": "xZ7ritqyKqCy4Du6j", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall g:Group | some t:Teacher | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "r3ejDkoWHygLaJAwc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 14:47:48"} {"_id": "ttchHhvZC89Hb7Ja7", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iht99inQjma4vG2x4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:32:27"} {"_id": "uZJ2fafHmoFuJbE4f", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies 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\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "GpSRXWHT9uofoGjdS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 14:41:17"} {"_id": "EZ47SwHNfapwvBEHB", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p not in Student and p not in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LrG86s27gqeyfoi5D", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-29 17:28:00"} {"_id": "2ogKPZnqHdgbxkbRr", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n \tall p:Person | p not in Teacher \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t1,t2:Teacher | some c1,c2:Class | t1->c in Teaches and t2->c1 in Teaches implies t1=t2 | \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LCHFEdY7d7GsrksKi", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-28 17:01:09"} {"_id": "KPCKfa6uKAhEwNTHm", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class,g:Group | some t:Teacher | c->t->g in Groups implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "XGwSs3Bi4NQXy3TTx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:58:57"} {"_id": "xwZCeAvyb6hMeaM3p", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bZtujdZ392ARtzyLs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-1 17:27:56"} {"_id": "JejMHXs9mwhtKmYNk", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , g:Group | all s:Student | s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DnYbbCz8ZNAXfbcnE", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:16:32"} {"_id": "u6qTgNSz6r73kvngq", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\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 | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qkCyj2GYiPiQqHCyQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 11:55:30"} {"_id": "nrs5rDGmjLZoc2sMN", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^Tutors\n}", "derivationOf": "m6TNohrCHu3ZKX2DH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:49:18"} {"_id": "cbLxGhgQFJmf3Df4o", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "SEKE8gm4QAL8q3m5W", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:20:09"} {"_id": "J9gEEg7q58zz7wEQa", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "ESMy5pNeT96sfrwBX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 15:49:31"} {"_id": "2XaG3gfCp3dHrEaLF", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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 t : Teacher | t -> c not in Teaches implies not (some p : Person, g : Group | c -> p -> g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sGYPtKGs66jqdeg7E", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:02:29"} {"_id": "JZtGouSwFWJTWspwW", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vYdTA43wSyhgKDyyd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 12:53:52"} {"_id": "KPyJjpjvvJJq2Y6Fr", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | (some c : Class, g : Group | t->c in Teaches) and c->t->g in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HZeHvMfXgd4ES652B", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 20:58:03"} {"_id": "ppmLmry2rzrGmuuks", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class, s:Student, g: Group | some t: Teachers | (c->t not in Teaches) implies c->s->g not in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MyDtiicX52L2nYSem", "msg": "The name \"Teachers\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-30 22:15:29"} {"_id": "kGA3nRoneLFY59Y5N", "cmd_i": 12, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutor implies x in Teacher\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qxNKjBnbjWNbEuEug", "msg": "The name \"Tutor\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 11:29:55"} {"_id": "eWxwg9tPYDic5BdqW", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Person\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4SA2ZtkaZ35wHFB3q", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 11:59:15"} {"_id": "CuNWTDY8HSZ7cRpg6", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RQTSGKw4wKfTTZAbo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-21 16:45:55"} {"_id": "eJPK5WtxtQqhfGB2b", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, x, y : Teacher | y->c in Teaches and x->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "w8bLgdSD9L5eFNwj2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 17:39:31"} {"_id": "MZotehW7DvyqaSfcK", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, g : Group | c->t->g in Groups \n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BScFapefTHZTDH9C9", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 11:38:51"} {"_id": "C3yoFdKfaAWtHEzBn", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | some p : Person | p in Teacher implies p->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gdnLhDqhKF3MKHj6r", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:33:41"} {"_id": "SuFb4r8PHcHRdsdwh", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n Teacher in Teaches.Class\n}\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QpNKfFwen4kf4bi6a", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 10:29:01"} {"_id": "qpAqehMJgQFND4Rug", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class | x 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zjst9h3Y53xe6FqEK", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:39:32"} {"_id": "ktyz5bnHyELE8KhMQ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups and some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8Qs8S8TMvYo78EzNK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 11:28:15"} {"_id": "uwdsqaP8KvBNpzZGb", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher, y : Class | some z : Group | y->x->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mKJXDkSnG5qdLAtcu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 13:20:25"} {"_id": "cQhXusHYPYBYi3rvP", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cqg55KHY58aLbDF7z", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 21:26:24"} {"_id": "Q8MCcBvgHFDvs9edm", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uKbWNDcgWj4c6vxGd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:29:46"} {"_id": "Z6CjMSi9yw8Jg9NMT", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->p->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jmJora7yKbTvfE3fX", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 20:37:52"} {"_id": "kYmZRuomj3MnzjbCr", "cmd_i": 4, "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall p:Person | some c : Classe | p->c in Teaches \n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7FG84ih7wW4YJw5jP", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 10:42:46"} {"_id": "Mh3siMjJnictGyo3S", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, p : Person, g : Group | c->p->g in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\tall s, t : Person, c : Class | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p,q,r : Person | (p->q in Tutors implies p in Teacher) or \n \t\t\t\t\t\t (q->p in Tutors implies q in Teacher) or \n \t\t\t\t\t\t (q->r in Tutors implies q in Teacher) or \n \t\t\t\t\t\t (r->q in Tutors implies r in Teacher) or \n \t\t\t\t\t\t (r->p in Tutors implies r in Teacher) or \n \t\t\t\t\t\t (p->r in Tutors implies p in Teacher) \n}", "derivationOf": "om9SKXQnxoiAi2beW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 20:50:40"} {"_id": "3s3xqYvLkJyJm6YpW", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | lone x.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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "p6PjDMQQLBA5Zijsr", "msg": "This cannot be a legal relational join where\nleft hand side is x (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 17:15:32"} {"_id": "qmt6j8vfGPsmsBqeL", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student|some t:Teacher, g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n\npred inv12 {\n\tall t:Teacher , s:Student | some g:Group ,c:Class| t->c in Teaches and c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t:Teacher , s:Student | t in Tutors and |(s in Tutors)\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HRsovjGKiozZd8YiW", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:31:04"} {"_id": "H2f3pEHvs4Ng8vmKQ", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \t\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\t\n \t or p in Teacher\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher.Teaches in Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YhJzRWeNYLm7utE97", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 18:12:33"} {"_id": "96KjnxFdd5d76H8KE", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ttchHhvZC89Hb7Ja7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:32:55"} {"_id": "Rj6ApYwXueBupgQnA", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9pLDgeC6rWwPAH3gB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:26:19"} {"_id": "AwQ5TpThjMZeyL6A5", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AB7cn2ygP5FZu3gBZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 11:14:43"} {"_id": "HedgttXG5WApk4zcG", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jmFXBTJpGsb9AC4W4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 10:48:10"} {"_id": "XYSsPo5cmtz77R2pg", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher,c:Class,g:Class | (t->c in Teaches) implies (t->g not in Teaches)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,t:Teacher,g:Group,s:Student | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher, c:Class, s:Student | some g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wyKwteKBhNomS6J9q", "original": "YH3ANm7Y5Qe5dSYem", "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": "Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "Student:Person"}, {"parent": "Person", "type": "Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 177.60000000000002, "y": 238.79999999999998}, "Class1": {"x": 355.2, "y": 238.79999999999998}, "Class2": {"x": 532.8, "y": 238.79999999999998}, "Group0": {"x": 222, "y": 318.4}, "Group1": {"x": 444, "y": 318.4}, "Group2": {"x": 666, "y": 318.4}, "Person0": {"x": 710.4, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}]}}, "time": "2019-9-26 10:51:50"} {"_id": "mXZ3AioMBZ5EkvSih", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n \n all c:Class,s:Student,t:Teacher, g:Group| some s.(c.Groups)->g and some t.(c.Groups)->g implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "eE885QQtS4pCiTAtA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 21:17:43"} {"_id": "AqPcciqedh7fWbuso", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, g : Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oC24byGpQAg4GSCYL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 20:52:31"} {"_id": "zTnKYuTmbC5LD4HFG", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "46PLfwkbXLj5qHMNs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-13 17:04:32"} {"_id": "oR6bNauSYgNfvHWgt", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "T3x3wz3DPW6SD3wdC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:29:48"} {"_id": "XJkDT7ucFL6P4rMFw", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "W6uKRoZrMHFHEGMWM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 14:56:31"} {"_id": "B5bLBudfnck65sjXc", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There 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\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pujxZpPnerNuRByqZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:20:12"} {"_id": "nthPkzYSNXsaghmXP", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HjkMZd7zAsNzaJrRn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 12:11:03"} {"_id": "xif6vgybF2xirG6hB", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FrsAAMNrkuoDzubAh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 09:16:45"} {"_id": "7SLDdKgHS8qCDHC4C", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, g : Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t : Teacher, s : Student | t->s in Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dKHCGys5chnimCijE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 20:50:28"} {"_id": "uHabBXA4jcmWT4zpY", "cmd_i": 4, "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some g:Group \n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "J3tEZducPMzFN6SSv", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 10:38:36"} {"_id": "yqkQWzP24v2qFPArs", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Person,some c:Class | p in Teacher implies p->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "C8qKLjrWqLy6bG9Sa", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-28 21:46:53"} {"_id": "rjNKvQ5nFJQhkC42b", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class, g:Group | some c.Groups.g implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TWgj6HhjdpgtLsoZL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-30 18:43:29"} {"_id": "p5XR4ty2wovw4Wbvi", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rwqCnmGpZ6KyXa2DR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 10:20:13"} {"_id": "mDbzuyGef6EBiFQi4", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome c:Classes | hasTeacher[c] \n}\npred hasTeacher[c:Classes] {\n\tall g:Group | group_has_teacher[g]\n}\npred group_has_teacher[g:Group] {\n\tsome p:Person | p in Teacher and p in g\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ewQevandJwBWbrBPk", "msg": "The name \"Classes\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:33:49"} {"_id": "BECnhma7FtkSsKd6F", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\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\tsome c : Class | (some p : Person | some g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "v4W2EM5riZce3HT8i", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 20:40:36"} {"_id": "oAikYjAkrcMySBQTr", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,t:Teacher,g:Group | one c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "f2kmJvJ5atJdwYAct", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:23:09"} {"_id": "dKHCGys5chnimCijE", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, g : Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7i9g6YpruGnMvL7u7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 20:48:43"} {"_id": "F2KMcvNfRjQ6rHpqq", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "p4yXwmQ68dx4ASrcx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 21:38:11"} {"_id": "Q7uXP3hd2FqTRFSM9", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "KpRY2AaTjqgAdurfP", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 21:24:31"} {"_id": "78imGwkM9fj5TkDkr", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5gEJ7A53bBFuD6fDH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 10:34:20"} {"_id": "MEnez7xZeAFhF537X", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 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\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tvfsHjGAWnEzEH6k9", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 17:18:46"} {"_id": "arMqoTtSngKt83KwK", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qrRZMNP2cbJYA28PY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:27:36"} {"_id": "WujFyFWn3ZCJeQFWy", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "w823eH7Lobc4HAujC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:42:29"} {"_id": "rHHtPeGNS6xrRWori", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | some p : Person | p in Teacher implies c->p\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "C3yoFdKfaAWtHEzBn", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:33:55"} {"_id": "GWKFhe5ae8aBwiCyi", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7A5z6FTBY7eQXLrWQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-13 16:08:56"} {"_id": "gBnhXd93RPNGxSLDp", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\n \t\n \tall c:Class,t:Teacher | Teaches.t\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\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n \t\n}", "derivationOf": "zbHbznJnujWR8e7DR", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 20:25:56"} {"_id": "MqnoNGumpXiWBCdcA", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n \tall p:Person | p not in Teacher \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Sk9i345AHYH6PnxkC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-28 16:45:21"} {"_id": "GTdapbD6DYua3sxhL", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n \t\n \tall c:Class | some t:Teacher | some c.Groups.t implies c in t.Teaches \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "2hEmhW3jd8qkL98Mt", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:31:18"} {"_id": "kbRtr5daFX3Gug4Xw", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlone Teavher in Teacher.teaches \n \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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xNNGdB8uSJswkyfGA", "msg": "The name \"Teavher\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:49:23"} {"_id": "eJXp3goRrMH4gEMeE", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tt : Teacher | some c in Class implies t->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "euSPp889R4RJhepbf", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:29:56"} {"_id": "Zjq5y5FAzeN8d78eW", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7x83YCsmk5BNEF2KR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-10 18:08:00"} {"_id": "iSSmHbJ9Sc5qPmRvn", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gSuKMQFdS42oCHckt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 11:30:38"} {"_id": "mmoWShZ4P5dFeaNrc", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "QSDmQNaYgNodpzo7w", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 10:17:53"} {"_id": "2Youb7CApDSscgNPP", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher, y : Class | some z : Group | y->x->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uwdsqaP8KvBNpzZGb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 13:20:49"} {"_id": "gQPEXHmdEnYAEhTMJ", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall t : Teacher | t not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some c : Class | c -> t 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JXa3wptxpxTmxwKE9", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-18 17:01:00"} {"_id": "5WDrQt9vcTLLPWjLX", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\n \t\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\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n \t\n}", "derivationOf": "MfdxAEjEZMjf88PJ2", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 20:26:21"} {"_id": "xNNGdB8uSJswkyfGA", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { \n\tsome c : Class | lone Teacher in Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zt5Y8WKBzRKLQBXvz", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:46:27"} {"_id": "Dzrsju4fkR38zB7pS", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some q,r : Person, t : Teacher | t->p in Tutors or (q->p in Tutors and t->q in Tutors) or (t->r in Tutors and r->q in Tutors and q->p in Tutors)\n}", "derivationOf": "xnr6L5zARSwoWroMp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 05:56:44"} {"_id": "JtZwEMyYujwdTg5ie", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student | s in (c.Groups).Group implies some t:Teacher | t->c in Teaches and t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "JQxLyh77dw53sgsHm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-30 18:56:57"} {"_id": "Fqdj69hXk7MW5pSHL", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Teacher | some c:Class | p->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c:Class | t->c in Teaches implies one c\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PuyTg2QYhJgXtknZc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-28 22:04:37"} {"_id": "pxBv7LqdA7qh4idiy", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "BvYSriFMyMEy3Mkwf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 15:49:07"} {"_id": "GwwyaMharqbDjea4w", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EgXTvaQcaGHo7DuxP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:26:36"} {"_id": "22c33R4ECiCdiSyMg", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student | all g:Group |some t:Teacher| c->s->g in Groups implies t->c in Teaches\n \n \n \n \n \n all c:Class,g:Group,s:Student | some t:Teacher | ( c->s->g in Groups) implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4fuoDgyZBCzuDqJMa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 13:58:36"} {"_id": "j5GfMaKAQbbtAhAMY", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | y in Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "thPT4E7P5tBABe95h", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:35:42"} {"_id": "f6pepXxixQmBsDXkE", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 in Teacher+Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JGYpuLCECEABrN9oB", "msg": "This expression failed to be typechecked line 62, column 2, filename=/tmp/alloy_heredoc5378366879501114063.als", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 11:21:59"} {"_id": "9M6ewWznfpmKgvuiQ", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "aaQZ6xA5ZPLKD86yi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 21:29:19"} {"_id": "5HR8T9qqLDhcshzvF", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher, some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NiPmsToXAgeAj7bzP", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:38:36"} {"_id": "udx8keDFLzALdp54D", "cmd_i": 2, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XMC53NRwmW3fFDMo6", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 21:20:33"} {"_id": "w7DBuFKibXc9X4CR5", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \t\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\t\n \t or p in Teacher\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dmDeKQ6wiHCHTZi4H", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 18:09:27"} {"_id": "ZMmGdEMTd8CjJ6adi", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MEnez7xZeAFhF537X", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-10 17:18:56"} {"_id": "D3oSs8DhMZZp45fhC", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t:Teacher,s:Student,p:Person | p->t not in Tutors and s->p not in Tutors \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rapTwQewEFkQZ7Sst", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 19:00:20"} {"_id": "NDjjXwoqYZ6KKru8i", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student|some t:Teacher, g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n\npred inv12 {\n\tall t:Teacher , s:Student | some g:Group ,c:Class| t->c in Teaches and c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t:Teacher , s:Student | t in Tutors and not (s in Tutors)\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7F7YiqH4pBmPmCRAs", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:31:26"} {"_id": "nMzNJ8D9g7D3BDbzJ", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\nall p : Person | (some c : Class, g : Group | c->p->g in Groups) implies some t : Teacher | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ATrtjtDdHEfHwqGgH", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 11:14:22"} {"_id": "8ZqRo68aZniip7hQ7", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 17:56:32"} {"_id": "jo6S3j9NqaXbGzbBC", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XHpffQ2WmuzhgzuD2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 11:30:47"} {"_id": "zPePfRrk8TGd3zSNX", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some q,r : Person | (q in Teacher or r in Teacher) and (q->p in Tutors or r->p in Tutors or r->q in Tutors)\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 22:04:59"} {"_id": "vYSSX7zBeRSZWLKRx", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "S5Pf4FGKELajeMbTQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-30 18:18:05"} {"_id": "iuWkzbctN9Tzfx4ZA", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tt : Teacher | some c in Class implies 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DLAofvfh7koWAGcms", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:30:37"} {"_id": "7pD2Qf2TfPbxYfTn7", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | s in (c.Groups).Group\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "JtZwEMyYujwdTg5ie", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-30 19:18:17"} {"_id": "bf7dxfESxdZTXwJe4", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\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\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n \t\n}", "derivationOf": "aQD9Po7HQzasfNWq8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-4 20:20:42"} {"_id": "3vzw5iDtRDJAfdRv6", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t all c : Class| some t : Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n }\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some g : Group, t : Teacher | c->t->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ibcvLbvWKoWjWax3c", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-9 00:31:15"} {"_id": "ZiRW6W5aHB3Zj3TzC", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,g:Group,p:Person | some t:Teacher | c->t->g in Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PNoB44Kd42osb2tHz", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 20:46:43"} {"_id": "8msmxSsYBxPHmFxLn", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student|some t:Teacher, g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher , s:Student | some g:Group , some c:Class| t->c in Teaches and c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oFkGSZkahGz8grjyC", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:28:24"} {"_id": "FDin2oHtZnau2ejbf", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 \tall c:Class | lone Teaches.c\n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kpfSoraoFyFoto5ZQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:32:01"} {"_id": "5FtoEjXrQtgGTu65G", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9kNGf4e9H2dKoE8cn", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-7 12:13:39"} {"_id": "odYb9oHpmnhh9vHyk", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QZmSWRNt263nRwwfE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:34:34"} {"_id": "2ynX8maM9FSM9hQv5", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "X8DQCgQusrwSHK5Ka", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-3 00:11:57"} {"_id": "2oKbbujLcwLvxp4La", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\npred inv11 {\n all c:Class,g:Group | some c.Groups.g implies some t:Teacher | t->c in Teaches\n}\n\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "j9oM7kobNPMQtFo39", "original": "YH3ANm7Y5Qe5dSYem", "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": 740, "y": 199}, "Group0": {"x": 592, "y": 199}, "Group1": {"x": 444, "y": 199}, "Group2": {"x": 296, "y": 199}, "Person": {"x": 148, "y": 199}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "this/Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "this/Teacher:Person"}, {"color": "inherit", "type": "this/Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "this/Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "this/Student:Person", "visibility": false}]}}, "time": "2019-11-21 11:40:32"} {"_id": "GGZCTSkQYZbzLJcbF", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,t:Teacher,g:Group | lone t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "rbyM5jKAx94kFDvbz", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 11:21:55"} {"_id": "pN89HezGHdCiQ7M2c", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class,g:Group |some t:Teacher | some c.Groups implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nW4iwCFfv6jb78hTW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 11:00:47"} {"_id": "rACCeQtuhD7wdiNfy", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tTeacher in Person.~Teaches and Student in Person.Teaches\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QAYoMzRqJXB2B6Jus", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 21:13:51"} {"_id": "BXc96XyY6w8qdN9t4", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tTeacher.Teaches | one Teacher \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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QwKB8QNBrzkvHxCya", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:54:09"} {"_id": "qd6piJPd5vAcrra87", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall t:Teacher | (some g:Group , c:Class | (t->c in Teaches) and (c->g in Groups))\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "u9rzKyXbBGeZweLkp", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 14:56:34"} {"_id": "Sk9i345AHYH6PnxkC", "cmd_i": 2, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n \tall p:Person | p not in Teacher \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student | p in Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tWNgXc8ww4S4DkJhy", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-28 16:44:50"} {"_id": "t4bJK5ZG6TryiQk99", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (\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\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZXphbpSNHe5sa9nke", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:34:13"} {"_id": "nS3kg9iaiSFAfXtLJ", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Person | some c : Class, g : Group | c->p->g in Groups implies some q : Person | q->c in Teaches and q->p in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tmm8hwthDQRm38h3y", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:51:49"} {"_id": "Bj67kKQx4G5sj7Dwn", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class |some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TJDY4euZeY6C5tP3Q", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:38:46"} {"_id": "FLQFWbB4frQS35oSB", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\t\n\n\n\t\n \n \n \tall c:Class,g:Group| some t:Teacher | some c.Groups.g implies c->t->g in Groups\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "o7dNGnPpBubA4gq9h", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:24:42"} {"_id": "RsgpmMFqzrFwKNtbw", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rf64ACcKTTEYWntsX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 23:57:45"} {"_id": "g6WRrwT6ofpEp82LT", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4ZDTd9yZbwBjXj7Xc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 18:23:57"} {"_id": "zE9piYTrtvzaqQagB", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n some Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "xdDkL4w4NsqY9vQs5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:17:50"} {"_id": "yfRNtDkHYbio3mBfr", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches implies some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Person | p in Class implies some t : Teacher | t->c in Teaches and t->p in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ozyZLhwPj5DcHcBLn", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 15:33:10"} {"_id": "8YeETJZTwds3gwqmg", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \tall p, q : Person, c : Class | (some g : Group | c->p->g in Groups) and q->c in Teaches implies q->p in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tsome p,q,r : Person | (p->q in Tutors or q->p in Tutors) and (q->r in Tutors and r->q in Tutors) and (p->r in Tutors and r-> in Tutors)implies (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "AkBwhkxx8h4SX4qHH", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 16:05:06"} {"_id": "LRTsiXo6X8fHtkQRs", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \tall p, q : Person, c : Class | (some g : Group | c->p->g in Groups) and q->c in Teaches implies q->p in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tsome p,q,r : Person | (p->q in Tutors or q->p in Tutors) and (q->r in Tutors or r->q in Tutors) and (p->r in Tutors or r-> in Tutors) implies (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "Hu7a9HyiseaSdf6Ex", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 16:05:44"} {"_id": "xAH3auhe68dzHwcEo", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class,g:Group |some t:Teacher | some c.Groups implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4oY6FFZt2Z6ayCca2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 11:00:27"} {"_id": "tCyJthGhPatJoz2t2", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p != Student implies p = Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "afLNss3dyniMd5ngY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-21 16:42:43"} {"_id": "gNZzm2kWhAcyRbAMQ", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | (all c:Class | t->c in Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "F2KMcvNfRjQ6rHpqq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 21:45:41"} {"_id": "GEghdT8oiHqroG7rC", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9SdZQbnFmDh73YFKJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 18:23:46"} {"_id": "Q9TvbdkdzYmm4hmhC", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Toutor | t in p.^~Tutors \n}", "derivationOf": "rZqjE6zMHHq9KkouT", "msg": "The name \"Toutor\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 09:50:17"} {"_id": "tYFduz6eYT5n8ByYj", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8JoP4NjTuwBwf98EW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:32:36"} {"_id": "KaBrH2deCoM5Te2Ec", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | (all p:Person | p is Student and (some g:Group | (p->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "59kNCGSdq7PteNFkr", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:49:29"} {"_id": "6hTwZYr6i3tsRXoAe", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all x : Class | some y : Teacher | x->y 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mSL6wGvZyeEaCFf3p", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Person}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 12:02:54"} {"_id": "pujxZpPnerNuRByqZ", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There 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\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YETcANih2sX46Fvvm", "msg": "The name \"class\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:20:04"} {"_id": "6g5twzCN7C3eq6JLa", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t all c : Class| some t : Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1->t2 not 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AWizfhyH8NtpSrmkQ", "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": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-9 00:20:38"} {"_id": "4WKWdoj8ufKPp66a8", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BaevqBH3Ya4BZg5AK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:17:59"} {"_id": "f8cZNMjCiDKwwNLXt", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | c in t.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\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 | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some g:Group, p:Person | c->p->g in Groups implies p in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cpkkrX4khtttoqpKn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-21 18:01:44"} {"_id": "SoaSN84AKsJjaSC8n", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XFF9EpikQgdeHgzwh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-10 14:50:24"} {"_id": "PfqePMTzPLC7aQtKZ", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n \tall p : Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | (some c : Class | t->c in Teaches)\n}\n\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | (some t : Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "K7ufaNxN4CgZ4ap6J", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:34:50"} {"_id": "EJAg3NRdoZKfBon4A", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class | some s : Student, g : Group | c->p->g in Groups implies some t : Teacher | t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RM69PkaAFuLqXN8D5", "msg": "The name \"p\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 21:18:16"} {"_id": "fzWo22wE3YwHYYKQu", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:13:07"} {"_id": "PYYsQo7nsZ5amexnB", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\nall t : Teacher | some g : Group, c : Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\nall x,y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\nall s : Student | in Class implies some t : Teacher | t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ahK3eB8tTv9tpQCjo", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 11:34:00"} {"_id": "GKq9CugbDki2kEELs", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rNiGFWu8SRxjZry4G", "msg": "The name \"teaches\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-2 23:54:00"} {"_id": "PQqqZacPiBbXNeYQW", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HedgttXG5WApk4zcG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 10:48:33"} {"_id": "GheD7WHKWDFp65yJB", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\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\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NA3Bb5jKzghvNaFtJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-4 20:00:35"} {"_id": "6Y9F3vWEZgYNckR2H", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AAgmXi8qd5ERgJRz7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-9 00:04:21"} {"_id": "GYtQEHktmFs8FrN92", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DmpTtQn5QxkRYgxxY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 17:21:00"} {"_id": "kbLnKWHQArw5ffH7c", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Kg37MjZDPoxN9eFY3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 17:58:00"} {"_id": "2s4hfd5JiDMbmqN3k", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BnkSXceT3ezk7TXac", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-13 16:13:59"} {"_id": "d9jJzaZdPNRqYki82", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student,s:Teacher |some g:Group| s in c.Groups.Group and c->t->g in Groups \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "r4LyM8LAoP4Boz65A", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 12:56:02"} {"_id": "8aQpeLvvhRCJ22CEx", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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\tall c:Class | some c.Groups.Group implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "s2p59BdQsqrxD9ek5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:50:26"} {"_id": "L3GpsvkYjb4d7mbR6", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 all c : Class | all s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all t : Teacher | (t -> c not in Teaches) implies (all p : Person, g : Group | c -> p -> g not in Groups) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | t -> c in Teaches and (some g : Group | c -> s -> g in Groups) iff t -> s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "syCKjph8korj95zrf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:15:46"} {"_id": "QAaFxmifNHY39Q5Rk", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "RvjkTnrFcBgrFhhxW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-13 16:53:12"} {"_id": "CcEDvwzNfrfDRRk5x", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n \n all c:Class,s:Student,t:Teacher, g:Group| some s.(c.Groups)->g and some t.(c.Groups)->g implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "Cjps7ofLo3RfiBD9o", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 21:18:15"} {"_id": "PaYBkkDoaMQ4ggm8n", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zWczZtoc2aZTRJJna", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:40:06"} {"_id": "PLEeub8SREbioRZTe", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t:Teacher,s:Student | s->t not in Tutors and t->s in Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YQyZKu2S8hzjMeNjW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 18:57:38"} {"_id": "L4acDGMAFXoA7bBDQ", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class 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 | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2w8th3p4QkmqcssZE", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:18:44"} {"_id": "A4F8gtDpQx4W3Hn2r", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n}\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\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AJKNB3N2qA5Tk67YK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:32:52"} {"_id": "2XQA7sCc3qx4P67h2", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class,g:Group |some t:Teacher | some c.Groups implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "75ecJRwE4zSL3rbe3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:59:00"} {"_id": "bzijHZdFt468TYTBj", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Teacher | some c:Class | p->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c:Class | t->c in Teaches implies one c\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "z8DKCB3GjPCe6xKNe", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-28 22:04:59"} {"_id": "D2PtKsu9npqYgjFPX", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class, g: Group, s: Student, t: Teacher | c->s->g in Groups implies t->c in Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FkpwyGfXMWbBeHxtv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-30 22:24:33"} {"_id": "tt3HFXnYvPvADPBtm", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class | some Person.(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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "JvwWzwKk43s3R3CE7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 14:38:28"} {"_id": "Lyb7y5BY2R9gaY4Qi", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Haf7YbQQvnLf7BiEt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:06:51"} {"_id": "NYGPtw5FQsGrEeQ4k", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall s:Student,t:Teacher | s!=t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Classe,p:Person | c->p\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PKwooxLeQyjZYeEas", "msg": "The name \"Classe\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:33:05"} {"_id": "iA3FsG4DJ4vw9ZdJ7", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c :Class, s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3wMuejExmZ2Gsm4hF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 22:36:42"} {"_id": "JDCFzXpMgFuZ9yr2g", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\tTeacher.Teaches -> lone 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dLkaTbFZ8Jc3yZ9Mu", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 17:35:04"} {"_id": "PuyTg2QYhJgXtknZc", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Teacher | some c:Class | p->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c:Class | t->c in Teaches implies one c\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \tall c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "86uLKKfDKDKeHqZZS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-28 22:04:23"} {"_id": "GtP2YzagDbhqmdWyT", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\t\n\n\n\tall c:Class | some (c.Groups).Person\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "vQkgDyqdEzQ3Ys2rD", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:13:21"} {"_id": "oBsAtHyAoNCjvNewX", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 \t\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FEuRNWYLncRMofS3A", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:23:24"} {"_id": "BBmYLBhJrD8kiQmpa", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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 Person.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SLwdXpFieeoW9GC8c", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 21:15:24"} {"_id": "K2NKawmK4pbR27p5g", "cmd_i": 2, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall t : Teacher | t not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Teacher and Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2N6et9MyMEiR2HDeQ", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-18 16:50:57"} {"_id": "v4YZk5kLzbpzsSsYg", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n some t : Teacher | all c : Class | some s : Student | some g : Group | c->s->g in Groups implies t->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mkkiMhjnzEm9JdCgS", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:22:21"} {"_id": "jDevARXS5khCCJn6D", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome p:Teacher,c:Class | p->c in 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\tall t:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sZNXmMusXkhKFb8aM", "msg": "The name \"t1\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:40:24"} {"_id": "aSopLHwxnKt6mP93N", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t~Teaches.Teaches in iden\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6ygkjkARAT4aMZtCT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-4 18:00:08"} {"_id": "JtPaFMrJjRJYgJciT", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xfGKobHqqCGW4Pfak", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 21:20:46"} {"_id": "PqcCBYsYhPpFNPpBA", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\nrun {some Groups}", "derivationOf": "ZQBsdpmQmSGtp6Z66", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 13:29:47"} {"_id": "xc7roE88QrtpCB7xo", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in Group.~Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "xym8daAemkG3XjJwR", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 10:20:20"} {"_id": "rf64ACcKTTEYWntsX", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GABbRtHRNGxwFD6vQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 23:57:41"} {"_id": "aeKHRQz2h5rmbJr5G", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher, y : Class, z : Group | z->x->z in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tWi4twPeeJuCWkQFw", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Group->this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 12:32:16"} {"_id": "3ChwqjB898fG2pxQJ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \n \n \n \n \n all c:Class,g:Group | some t:Teacher,s:Student | ( c->s->g in Groups) implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MvyfuFnwujWKwsJBc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 11:38:42"} {"_id": "6FWcDfHMZqSB4LNqC", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 22:30:52"} {"_id": "v9XaS5BHS8WtMfRdw", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher,c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3j7ZXiZ4h92YoTxZo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:42:50"} {"_id": "FHr96gsddTubeSxzz", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c,d:Class | t->c in Teaches and t->d in Teaches implies c=d\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CmvzYMYpeeavc3uJz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:31:25"} {"_id": "baTw2Losy7oGNa8ZG", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yjpvCR93RvfA4oCs3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 13:09:37"} {"_id": "phrbbxDuZQa7jDJ4H", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \n \t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tall c:Class, t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n \t\n}", "derivationOf": "xRk8R7YXZbnyt2jje", "original": "YH3ANm7Y5Qe5dSYem", "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": 222, "y": 199}, "Class1": {"x": 444, "y": 199}, "Class2": {"x": 666, "y": 199}, "Group0": {"x": 222, "y": 298.5}, "Group1": {"x": 444, "y": 298.5}, "Group2": {"x": 666, "y": 298.5}, "Person": {"x": 444, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "this/Teacher:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "this/Student:Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "this/Teacher:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}]}}, "time": "2019-11-2 15:52:56"} {"_id": "hmqoSPdkugHsFh9gG", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Lyb7y5BY2R9gaY4Qi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:07:11"} {"_id": "oFkGSZkahGz8grjyC", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student|some t:Teacher, g:Group | t->c in Teaches implies c->s->g in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6x57PegH2vSTCDBiH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:26:09"} {"_id": "RzTYwsPSD7ELk69aW", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class , t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c,d:Class | t->c in Teaches and t->d in Teaches implies c=d\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 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\tall c : Class , t: Teacher | t->c in Teaches implies some p:Person , g:Group | c->p->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "zfDs3xzK8dpvPnakd", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:54:09"} {"_id": "jaqYmfQr3C5A6N5KE", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aHkhZEspqZYSo294W", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-2 15:38:21"} {"_id": "DCEnF9K5gQmwLzdPo", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 \t\n \tall t:Teacher | (lone t.Teaches) and (lone t->Groups)\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZN8h3B6eMttYmwb3s", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:30:42"} {"_id": "Tv9uFE3pLGY47Qqn9", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CkRz3FNWLC4Do5pqE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:28:09"} {"_id": "BpjxsWWW5TRRKv37h", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \t\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPeople in Student or Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TkZr2ZdXH3ntJRfwd", "msg": "The name \"People\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:06:14"} {"_id": "B9tQxqLi2v6bQwrLY", "cmd_i": 2, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hmqoSPdkugHsFh9gG", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:07:36"} {"_id": "GY29xRqbv7rwLARwP", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n \t\n \t\n \n all c:Class | some c.Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "DEyGmWrcs54Z6upYL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:53:52"} {"_id": "ghPaj49BwkJoNZaPS", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class|some t:Teacher,g:Group | t->c in Teaches and s.(c.Groups).g and one t.(c.Groups) implies t in s.^Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "hoSviiC2SzvNGDyAC", "msg": "This cannot be a legal relational join where\nleft hand side is s . c . (this/Class <: Groups) (type = {this/Group})\nright hand side is g (type = {this/Group})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 11:38:49"} {"_id": "mDd5hX92L3PJ2gjaJ", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "c8y4BgrWJ59AyF3jF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-17 09:43:44"} {"_id": "wmwzxE2vGJon4JdFo", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | one c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "a3MnwqnjG4iPMMM5w", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-3 00:02:06"} {"_id": "gadxAfMZciW9rF2Lz", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-1 17:46:38"} {"_id": "bN4Ej5LrvBLT383Ws", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t.Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8gSfLFQvfxRrpJK6D", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 21:10:55"} {"_id": "MykkkX883HMaXXX5Y", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gwAedyQdFDjc7yJFC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-30 18:48:43"} {"_id": "RwfDGhrHN688ZvsxH", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some c : Class, g : Group | c->s->g in Groups implies some t : Teacher | t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jFWR7PCyE87RuSG3Q", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:13:44"} {"_id": "BNY7e3or6wzdWcuj3", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tnone p:Person | p not in Student and p not in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "avHvxCYqe4fs8RhXn", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:38:27"} {"_id": "KryQyQhaS6gMKp4MN", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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 \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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9tyYBEPKxQQmxkRMv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 20:33:51"} {"_id": "2sEbJ2RvFWHzL9X4A", "cmd_i": 1, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | o is not 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SGzdXYhpsFWrbcqRX", "msg": "The name \"o\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:21:23"} {"_id": "eqbK2c9NxuSnKbkAz", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tsome Groups.Group\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "5iMubzY9csq44QaJv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:50:49"} {"_id": "iqCdLpJPghgYCGcnH", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "F64dD5kSeQRe5fPuA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-2 15:28:01"} {"_id": "KgeWW9KAZ2SvPdcv2", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tTutors.Tutors.Tutors in Teacher\n}", "derivationOf": "ZiRW6W5aHB3Zj3TzC", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Person}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 20:49:21"} {"_id": "3zYwi7gJudeRRqM32", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "LicGAyrxorRADcD4o", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-17 10:00:36"} {"_id": "Kg37MjZDPoxN9eFY3", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 not in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8ZqRo68aZniip7hQ7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 17:57:33"} {"_id": "NgR99i6YNYWt5HAiY", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\n \tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DYEK9fPkXSKCKy54R", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:31:15"} {"_id": "goSZFFqT5ygD5FP7E", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tTeaches.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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "m79xnhkPdy8CzEY5z", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:22:09"} {"_id": "owNExFgusRjXSDq7R", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Y9TswJWyYqfqeDrbG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 11:30:22"} {"_id": "Tt8KMXkmWafyLmGqP", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher, y : Class | some z : Group | y->x->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2Youb7CApDSscgNPP", "original": "YH3ANm7Y5Qe5dSYem", "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": "Int"}], "metaSubsetSigs": []}, "nodePositions": {"Class0": {"x": 658.1444498697916, "y": 99.58333587646484}, "Class1": {"x": 246.80416870117188, "y": 199.1666717529297}, "Group0": {"x": 493.60833740234375, "y": 199.1666717529297}, "Group1": {"x": 740.4125061035156, "y": 199.1666717529297}, "Group2": {"x": 493.60833740234375, "y": 298.75000762939453}, "Person": {"x": 329.07222493489587, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}]}}, "time": "2019-9-27 13:21:04"} {"_id": "KiNCRskiAZX82LoXq", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall p:Person | some c: Class | p in Teacher implies (p->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wakyemK9BgHzChf3c", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 10:44:25"} {"_id": "3d6Yrd4RJKRciArTX", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 all c : Class | all s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all t : Teacher | (t -> c not in Teaches) implies (all p : Person, g : Group | c -> p -> g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hPicTur8shgLc3eHZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:09:33"} {"_id": "PW3yYST8YNFAx6gaH", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jWoohh8Pex9kEyim6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 10:56:00"} {"_id": "hvJm48m2GEbWbvsCe", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CuNWTDY8HSZ7cRpg6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-21 16:46:22"} {"_id": "gDQBTL2ghKzQ4qk5w", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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. */\n\npred inv11 {\n \n all g:Group, c:Class | some p:Person | c->p->g in Groups implies p in Teacher\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Fprz8GtxxGHLLFpu2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 14:30:55"} {"_id": "T2vt7AfiXFK29xNGE", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Teacher in Teacher.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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pubNbepzj6t7MQeED", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 17:29:49"} {"_id": "qNF8PwZN2TTF5p672", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cX5xtRhNRs4xz7NTt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 11:21:36"} {"_id": "9pLDgeC6rWwPAH3gB", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fWb5PMixrw8e4BE9z", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:26:05"} {"_id": "dMrahrwg6YnPAYCQr", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher | some y : Class, z : Group, v : Person | x->y in Teaches and y->v->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n\npred inv14 {\n all x : Person, y : Class, v : Teacher | (some z : Group | y->x->z in Groups) and v->y in Teaches implies v->x in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ywTbri7iJENv5w8Ew", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:48:03"} {"_id": "3wMuejExmZ2Gsm4hF", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all c :Class, t:Teacher, g:Group | c->t->g not in Groups\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c :Class, s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zq6wquQsjzgQW74ri", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 22:35:56"} {"_id": "fMt3ZNQtXfsRyeJAT", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n}\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\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4aWnXQFheef9atbt5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:42:49"} {"_id": "xrozcjtiu5MfJiEAJ", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class|some t:Teacher | t->c in Teaches and c.Groups.s \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "9cvhDHsW4nCv6kccn", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 11:33:34"} {"_id": "srydMkhrjE2hRbZfj", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class |some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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\tall c:Class | some Person.(c.Groups) implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "2b7f2TjwX38nD8bX4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:44:23"} {"_id": "6Y7Zpve8xwprytXGq", "cmd_i": 12, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class , t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c,d:Class | t->c in Teaches and t->d in Teaches implies c=d\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 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\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 p1,p2:Person | p1->p2 in Tutors implies p1 in Teachers and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SqsfJ8PkNioRcXrSa", "msg": "The name \"Teachers\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:44:30"} {"_id": "q4AmbviTjpk35oyjs", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Class | x in Group and x in Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Person | x in Teacher implies x 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "w6Y3irr2stR3v82Tj", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class}\nRight type = {this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:21:51"} {"_id": "vSDDsieNYQiaRN6uu", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher | t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | p.Tutors.Tutors.Tutors \n}", "derivationOf": "RySuqXSxcHN2TKtRs", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 21:26:25"} {"_id": "TkK6zwehM78hJvAki", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ohbFj7Apy8tFrrrX6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 14:57:55"} {"_id": "JuTYXKhCHhhyrSjDq", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, g : Group | c->t->g in Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nqKitpKqtK6QJ3iZM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:22:32"} {"_id": "ThWWqyEnW4fojd8Kt", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gPyps9AfhfNimYKBK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-1 09:54:00"} {"_id": "2b7f2TjwX38nD8bX4", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class |some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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\tall c:Class | some Person.(c.Groups) implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dfYDGZ8dCRs5Ya9mf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:43:58"} {"_id": "Ye6L7qizYcgqyHARE", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\npred inv11 {\n all c:Class,g:Group | some c.Groups.g implies some t:Teacher | t->c in Teaches\n}\n\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "2oKbbujLcwLvxp4La", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-21 11:40:58"} {"_id": "opA7ZPLoJWeDTpL2s", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall p:Person | some c: Class |p in Person\n \n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EkvDE2tboajf8MZji", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 10:43:34"} {"_id": "bGLxziXBQpRzCvG5S", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "MykkkX883HMaXXX5Y", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-30 18:51:00"} {"_id": "aqaCvj4iBStb7SHkE", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t all c : Class| some t : Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n }\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some g : Group, t : Teacher | c->t->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dGhtfzTh2wp4N4NBF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-9 00:29:44"} {"_id": "MTnhBQopkerqyFR7p", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fRSMF5fc9ugyYrKwM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 09:42:27"} {"_id": "ELHDviMn2ou7xvrR7", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t :Teacher | c->t in Teaches \n}\n\n \n\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6ycmekiDJHc6FGdPW", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Person}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-3 00:19:40"} {"_id": "f5qwMwwLKrCr64ZDy", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\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\tsome c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AiyFGTK5q9fka2uqb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 20:40:55"} {"_id": "mDdJ2uccBifPY5HZA", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GKq9CugbDki2kEELs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-2 23:54:12"} {"_id": "WhhQ8teeco7oS76aa", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^Tutors\n}", "derivationOf": "8udq8t54Ez3v3oLoW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:46:48"} {"_id": "kG4jXJA8hypLR9qwK", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c.Teacher 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2My2br5gMtE7k6wm3", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Teacher (type = {this/Person})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 23:59:00"} {"_id": "E6hzJ8TQT8MnnZ5zc", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "J2etjqZTvRHiPA3uy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 15:49:02"} {"_id": "BFJNKaeqeh7KsXMWh", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bvBKEFGCj4BYt8rcj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 10:50:04"} {"_id": "vdeiw3d4WTFJLgrs6", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "R8rgGG6L6JR8ABbcW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-1 17:30:11"} {"_id": "PJTLns64NpnuBavck", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher and inv3\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vnREk65RpDYtuuZ8K", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:09:02"} {"_id": "q3rrjcboFmMRMGsSr", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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. */\n\npred inv11 {\n \n all g:Group, c:Class | some p:Person | c->p->g in Groups implies p in Teacher\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TFxzjEb9edJosBBYj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 14:30:50"} {"_id": "Mr8aDTGDqLNqf78A6", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 10:19:01"} {"_id": "NA3Bb5jKzghvNaFtJ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\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\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7fAwX4G2YRnxA7EiZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-4 20:00:05"} {"_id": "ttMk88Birs3P8BMeH", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4RTNC5gtcRgRvBcnB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:40:38"} {"_id": "ewQevandJwBWbrBPk", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Witx46GJwyEPgpfL8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:25:44"} {"_id": "AnezJgGgaJoaeNvXE", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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 not all c : Class, t : Teacher | (t -> c not in Teaches) implies (all p : Person, g : Group | c -> p -> g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7Pn5k5zQ5Fg9P36gs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:07:48"} {"_id": "SuZYh422JWfJSxPY5", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SpA2jAsieXKanLFvf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 12:04:29"} {"_id": "aAyMyeqjgcbc8qxBg", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "mtJDsyoD5zttsXJbG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-13 17:04:23"} {"_id": "Ja5eWNzTRRQfiKruK", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t all c : Class| some t : Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n }\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, all s : Student, some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oEHDqyGhwMrySxzee", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-9 00:25:35"} {"_id": "mTfCzd4ate3SizjJN", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \tall p, q : Person, c : Class | (some g : Group | c->p->g in Groups) and q->c in Teaches implies q->p in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tsome p,q,r : Person | ((p->q in Tutors and q->r in Tutors) or (q->r in Tutors and r->p in Tutors) or (p->r in Tutors and r->q in Tutors)) implies (p in Teacher or q in Teacher or r in Teacher) \n}", "derivationOf": "AHKky9W3rdSNsPCtJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 16:16:21"} {"_id": "tDiPNkcqSpE4EkKKt", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tsome c : Class | Teacher->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kpcRgyBaf3ZZS9fPw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-9 00:02:33"} {"_id": "4XyMmJNyEP4f7pn6N", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XuqTpw7GwtbzeLZty", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 13:07:52"} {"_id": "gmAKk2TPHssWK274d", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tTeacher.Teaches\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bptLcjkFLSY672KMH", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 18:27:52"} {"_id": "tLHbkiaLxttJsQTi8", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FNvRkbTBBXJcGRf69", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 12:53:47"} {"_id": "yyH9tcR5d5LGeLqhz", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3PrvnJyvEqRdiHZo7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 12:54:04"} {"_id": "eFx77iewG7HWYoris", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZotXTjQovW6ifxXna", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-10 17:49:02"} {"_id": "cEk9RrWe9pQkEAYtR", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \tno Student.Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "mL5cgnM3ffgzLHjr4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:05:55"} {"_id": "ZSo2QzHB95tnRAaAh", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 in Student\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FbvFpmWh7EgDzoXrn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 21:16:50"} {"_id": "4WwWkE5awn6EB5tpY", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "zTnKYuTmbC5LD4HFG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-13 17:04:34"} {"_id": "e4ohGMSqMnoTzt9rC", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 09:12:43"} {"_id": "DiwKu5sG7KuuRjjs5", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JvKJASkX4qoDHJpMn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 11:30:47"} {"_id": "MvMR2sKeqw26XP3xr", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xKxKWnuhBwxCyvW57", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:25:57"} {"_id": "xKxKWnuhBwxCyvW57", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LwYcmrQbRRy6vgptq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:25:05"} {"_id": "KGBQ7rKxHxG5kXgSF", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TubcYWMWBX5Bej4AK", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:18:26"} {"_id": "8L2aWJeexepGRgWbz", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZMmGdEMTd8CjJ6adi", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-10 17:24:57"} {"_id": "5Mw6uLqHS9Xqhu6Hi", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\t\n\n\n\tall c:Class |some t:Teacher | some c.Group.Person implies t in c.Groups.Group\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "fG8nYmWJCgtHtvpfv", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 12:15:40"} {"_id": "R6i9w9JkTAkQvdE5e", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sAXjRf9FDXBfg7GC5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:25:08"} {"_id": "SPgvA25SrQ7CBiY4t", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "P55CBzRQR7AMqEAXH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 12:54:08"} {"_id": "MP3QytD9wcA49HhzA", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.^Tutors and t not in Person.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "Nd8aqYS4hhf4ZuApD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:10:31"} {"_id": "ERwbbZkvfXZe6hRu3", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome p:Teacher,c:Class | p->c in 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\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4Z5MFS8QZghj4sAao", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:42:40"} {"_id": "kXhRgf7SnyDLGQXT5", "cmd_i": 2, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YyJa2kBDCA4JLhZLq", "msg": "The name \"teaches\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 23:57:02"} {"_id": "P8xCuiWvRWWfWRsy2", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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 in c.Groups\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nFPevhX72jBWnSvDm", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 17:32:32"} {"_id": "27ai2vcEZebdyjyCd", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CsCPShXkBHqz2gBTM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-30 18:26:13"} {"_id": "RPiaiJqr3383KxsK4", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n \n all c:Class,s:Student,t:Teacher, g:Group| some s.(c.Groups)->g and some t.(c.Groups)->g implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "B6bQdCaDDSnmWQw6v", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 21:17:57"} {"_id": "ejY4mpr6EyL6wTfhv", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall p : Student | some c : Class, g : Group | c->c->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YoTC59YzKmkXxavcm", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Class->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 20:35:24"} {"_id": "HoFjjMpQyf3kESRZe", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class, s : Student, g : Group | c->s->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "v246DEZPMv3j87v73", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:42:19"} {"_id": "Xh3kcrqCyeGJSaB3E", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "FeAMjafjgkTJP5JAc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-13 16:59:06"} {"_id": "QdbPNt4649fbZFtdi", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Person,c:Class | p in Teacher implies t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EYYXquJyzkcJ64qeZ", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-28 21:44:17"} {"_id": "q92BgPpxPC9HuhgHk", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \t\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPeople in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BpjxsWWW5TRRKv37h", "msg": "The name \"People\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:06:24"} {"_id": "kpfSoraoFyFoto5ZQ", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 \t\n \tall t:Teacher,c:Class | (lone t.Teaches) and (lone c->t in Groups)\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DCEnF9K5gQmwLzdPo", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 09:31:49"} {"_id": "hibtBe6QWbcq8zvLx", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "EtBBkdRKFpinXY2Sn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 10:17:41"} {"_id": "ns6QcmNspg97jbhAB", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher|all c,d:Class | t->c and t->d implies c=d\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2ESMznB6vtKgthap7", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:30:46"} {"_id": "4AQnHxnw39gLmGsuM", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4J8sS2Kr8KrhgsN6R", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 21:32:12"} {"_id": "a8dpxf8cZETirhsWi", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n \tsome (Teacher in Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wBzQKgTPFPExujEbW", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 21:37:39"} {"_id": "pR3P3TmAsKFdgQt5o", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WMFmC8y5iyF2dko2y", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:44:26"} {"_id": "xjMweD8xy5gpxf8Q4", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n all x, y, z : Person | x->y in Tutors and y->z in Tutors and z->x in Tutors implies z in Teacher\n}", "derivationOf": "8GxyRjTsQbiAn7z5P", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 19:14:00"} {"_id": "BLxYx3iATHkcmAF68", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GekKTySShNcSDqzzT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 14:39:02"} {"_id": "5f4cSxTyLqkewNq2B", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | ((some g : Group | c->s->g in Groups) and t->c in Teaches) implies t->s in Tutors \n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zLNg6A765QWbXvDNw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:08:44"} {"_id": "CALFGA7qfgcKRFw2Q", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 \t\n \tall t:Teacher | lone t.Teaches & lone t.Groups\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7xmE2GA6XQSHpApm2", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 09:29:10"} {"_id": "3qMjv9p3ZXCJyY6if", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class, g: Group, s: Student | some t: Teacher | c->s->g in Groups implies (t->c in Teaches and t != s)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | some g: Group, c: Class | (c->t->g in Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iqHbZjv4Lk4aGxmoD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-30 22:30:43"} {"_id": "DHCtRkmNWNH42XQZA", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZrcALeQionN2C5QaY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-3 10:13:03"} {"_id": "kH9paApi6oyHvP4an", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n Class in Class.Teaches\n}\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dZGrKfS9MuRgYcksS", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-3 10:29:29"} {"_id": "NnahnRbpkKq7Zreaf", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \t\n \n \t\n \tall t:Teacher | some c:Class,g:Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "BLr6RrzZ98gPieiiT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 11:16:51"} {"_id": "XNPQ9Q5F8rkqhCas3", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "xwbDpprhigNHwfELd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-21 10:31:34"} {"_id": "2Lc6pvZkPTPhcpYLG", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-2 23:42:02"} {"_id": "zq6wquQsjzgQW74ri", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all c :Class, t:Teacher | c->t not in Groups\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c :Class, s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kkxCxJ86Paytcm9zZ", "msg": "!in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-7 22:35:31"} {"_id": "jWoohh8Pex9kEyim6", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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/* 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WAJvSL3XT2KFYNzGg", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 10:55:43"} {"_id": "G6nQ7RKaX5TA6TY2P", "cmd_i": 10, "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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. */\n\npred inv11 {\n \n all c:Class, g:Group | some p:Person c->p->g in Groups implies p in Teacher \n \n\t\n \n \n \n \n \n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aXrXyGrKytjk9geWw", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 14:25:35"} {"_id": "zKoghZXdiAh9zQwsW", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p not in Student and p not in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tTNjmjSwAeRqfGiqc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-29 17:02:59"} {"_id": "riCpAQea9wM6nmt9n", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "4WwWkE5awn6EB5tpY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-13 17:04:39"} {"_id": "JrpkK9fJQgry8sxuf", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SWfwXA5XhFPP3gDFi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:43:14"} {"_id": "58YhdC4SywuaPucrK", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | (some c : Class, g : Group | c->s->g in Groups) implies some t : Teacher | t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RwfDGhrHN688ZvsxH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:14:02"} {"_id": "TkeMSRcTMC4RFJmyJ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some t : Teacher | some s : Student | some g : Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "822ks3ZAxTwJPaWjt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:23:48"} {"_id": "ohbFj7Apy8tFrrrX6", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "annJMvvX48KMGPXry", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 14:57:26"} {"_id": "xv7ru7ZtreEfhg6in", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\n \tall t:Teacher | lone Teaches.t\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\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n \t\n}", "derivationOf": "bf7dxfESxdZTXwJe4", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-4 20:21:16"} {"_id": "F3Q4X5BDsXLZZj5rq", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors \n}", "derivationOf": "6HMPYhyLv2wzX6k69", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 09:57:21"} {"_id": "fiSwWbPBr9Kxo8f5g", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \t\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\t\n \t or p in Teacher\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "H2f3pEHvs4Ng8vmKQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 18:13:25"} {"_id": "cqhabJsn2msGTPEgW", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Person,some c:Class | p in Teacher implies p->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WxAurvwC9Xgrs3qSJ", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:28:23"} {"_id": "8xZ3SYPbjx9TdJCie", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eWxwg9tPYDic5BdqW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 11:59:22"} {"_id": "hKoXZsNrCb4Am6CoP", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 10:45:44"} {"_id": "xv642Jf48e6P5MsSq", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some c.Groups.g\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "pzxkik2usBJhqm5Zk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-13 16:57:57"} {"_id": "SpA2jAsieXKanLFvf", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher | some y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hy7nxr9KwAkFjfTCT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 12:04:10"} {"_id": "eXG2wa7YzY3acpjDr", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nME4Ki8cqH3yvkBes", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 10:29:10"} {"_id": "mkkiMhjnzEm9JdCgS", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n some t : Teacher | some c : Class | some s : Student | some g : Group | c->s->g in Groups and 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "A23No9zEvZeKWRYWL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:21:54"} {"_id": "Cw4Tf4vSJeTXcm8WG", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, g : Group | c->t->g in Groups \n}\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MZotehW7DvyqaSfcK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:39:09"} {"_id": "bmBzEGWFoj2L7Lmtw", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BCi7WczRtnQd4jNA3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 12:13:39"} {"_id": "Nziqm9DjMznP5sFp8", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:26:06"} {"_id": "i9An3Zs3Bxx3HFpps", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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.Teacher | c->s->g in Groups\n\n } \n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class| some t:Teacher | some c.Groups implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "a5dB5f26jc3HbyDyu", "msg": "This cannot be a legal relational join where\nleft hand side is this/Group (type = {this/Group})\nright hand side is this/Teacher (type = {this/Person})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 12:01:22"} {"_id": "8rkyFTdoedezKcuxN", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n \t\n \tall c:Class | some t:Teacher | some c.Groups implies 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "wL4q7RzwNvesL2Wmt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:11:08"} {"_id": "DnYbbCz8ZNAXfbcnE", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , g:Group | c in Class and g in Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "j4YEJPoGEkpfMnhuc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:15:44"} {"_id": "bBG5gA7WKjjmA5twr", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \talways (all p:Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student))\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "H9nTsAQefQiTXipCy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 21:28:16"} {"_id": "mTXXAB8KK82frrdzW", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Teacher | some c:Class | p->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c:Class | t->c in Teaches implies one c\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t:Teacher,s:Student,c:Class | t->c in Teaches and t->s in Tutors and s->c not in Teaches\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6GYf5xZKjDpmuRBkA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-28 22:10:09"} {"_id": "XZids7LBC4gsnArnh", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class ,g:Group | (all p:Person | p is Student and (p->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GibDvYtc48nFKZu6M", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:47:51"} {"_id": "5iMubzY9csq44QaJv", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "nrs5rDGmjLZoc2sMN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 09:50:01"} {"_id": "vwtyLF3xwqowEN4NG", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:19:04"} {"_id": "RXL68GL7L9aDXbHzT", "cmd_i": 12, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall p1:Person | isTutored [p1] implies p1 in Student and isTutor [p2] implies p2 in Teacher\n}\n\npred isTutored (p1:Person){\n\tsome p2:Person | p2->p1 in Tutors\n}\n \npred isTutor (p1:Person){\n\tsome p2:Person | p1->p2 in Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "edsXMPzAvSdGEyjMJ", "msg": "The name \"p2\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-7 18:10:50"} {"_id": "zHj3m7FFeRc87ZZe2", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tno Group.~Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "cEH6dtdJQjRzrMQbK", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 10:21:40"} {"_id": "jmtzzuGtQFdKbgYng", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some c.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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jo6S3j9NqaXbGzbBC", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 11:31:06"} {"_id": "GRszCL4i9xC9aTKmG", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\t\n\n\n\tall c:Class| some p:Person | some c.Groups.p \n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "vjZeMtw9gAy4aB6sR", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:18:16"} {"_id": "WALDKH6qhiDhJDAbA", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Person, | some c:Class | p in Teacher implies p->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fNr5hoRLiYQoaGrGe", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-28 21:47:22"} {"_id": "oTxY5Q2wXZLhFSERt", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\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\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student \n}\n\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student, c:Class | some t:Teacher | t->s in Tutors implies t->c in Teaches\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rxD6HL2rFjkzAuewD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 00:10:34"} {"_id": "TJDY4euZeY6C5tP3Q", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class |some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bP5jyDN3vNJvdPns8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:38:22"} {"_id": "9tyYBEPKxQQmxkRMv", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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 \tlone 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gmJYDuwBcQ37eMfsf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 20:33:40"} {"_id": "hgKsGaRptAtdLkRK7", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hSwusMJF56mKy9psv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-10 14:49:56"} {"_id": "wQpxs6xYZqXxj22fq", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t1:Teacher,t2:Teacher,s:Student | s->t1 not in Tutors and t1->t2 not in Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JCNE5EfkALiH9mZLh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 17:21:47"} {"_id": "gH6HeahgoTEY7WLpm", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | t1,t2:Teacher | c->t1 in ~Teaches and c->t2 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vcJmzinmrgfXvzPSP", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 10:30:59"} {"_id": "AAzb9onPg32ZxiJp8", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some c.~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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "c5TExwY6BKBCt9CB6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-30 18:29:57"} {"_id": "dyZw5n83kPFhxwLLC", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "f4uiit3xiwKNESoMq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 12:13:08"} {"_id": "fwCuLS2W36ixAtpHP", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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. */\n\npred inv11 {\n \n all g:Group, c:Class | some p:Person | c->p->g in Groups implies p in Teacher\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wKEdAXQ2EvLzkPHJX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 14:30:42"} {"_id": "gqkCZxEqKJC7Dj3qN", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8L2aWJeexepGRgWbz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-10 17:25:13"} {"_id": "Qw9MY2Zo5aFYBGKyr", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some s : Student | some g : Group | c->s->g in Groups implies (some t : Teacher | t->c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zZZbvqkdmNbmqokvi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:31:40"} {"_id": "8ksjuyEGWD978pJu8", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sHNH7mKXMADaeGxSP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 20:24:31"} {"_id": "YcSgPQT5GA4muqDg5", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nPWZuJRcbPmvbaELe", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 12:12:40"} {"_id": "5S8TksufjA3eih6Zx", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class, g: Group | some s: Student, t: Teacher | c->s->g in Groups implies t->c in Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iGLmPGBfJuLnbghfD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-30 22:23:22"} {"_id": "sy3zGGgKvfCTZzyAj", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tTeacher.Teacher | one Teacher \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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "geXe3pifaBXFPWeuP", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:53:29"} {"_id": "ADDoCdumTaHpyuDaR", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\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 | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5RQFMfJnt8TGRPco4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-10 14:53:08"} {"_id": "nx6nwxujqppeKTdbT", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n \t\n \tall c:Class | some t:Teacher | some c.Groups implies c in t.Teaches \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | lone t in Groups.Group\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "Cetqy6cn7hxhAQPMg", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 11:25:13"} {"_id": "dzanmfipg4rtaJogH", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher, some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher, some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "v3shj8hLdQN7yoFwu", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:11:24"} {"_id": "9HCrucHXNcp8MJFHH", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fzWo22wE3YwHYYKQu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:13:34"} {"_id": "cD23ad3p3TWmPjrQ3", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c :Class, s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5pgcv97ikppT6Xg7w", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 22:33:31"} {"_id": "SM5aw7s8jgenH6def", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | (all p:Person | p is Student and (some g:Group | (p->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 11:30:23"} {"_id": "wHrRkERMeydbLeED6", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Person\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BcZyS7xzWNEA4QfdL", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-10 14:51:13"} {"_id": "JCNE5EfkALiH9mZLh", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t:Teacher,s:Student | s->t not in Tutors \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fTRPbWXziwKphAJoA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 17:20:15"} {"_id": "v2hgg5QWphg3FW58w", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class | t->c in Teaches implies some p : Person, g : Group | c->p->g in Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "j4ZpzKcfrx9dhNdYA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:13:36"} {"_id": "5xxJrEKnCDswHR2qx", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student | all g:Group |some t:Teacher| c->s->g in Groups implies t->c in Teaches\n \n \n \n \n \n all c:Class,g:Group,s:Student | some t:Teacher | ( c->s->g in Groups) implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BthCqLjLTASSv7joz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 11:42:54"} {"_id": "bubEt4a7FkffBwzmj", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall t:Teacher , s:Student | (some g:Group ,c:Class| t->c in Teaches and c->s->g in Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student \n}\n\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zFWwW68hnmh2QzBa7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 23:23:20"} {"_id": "2WTmFMoeu434e3ipk", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "GQu7MYPFnsdSvCgBE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 10:18:03"} {"_id": "8cBCYQnqktk9Pafuo", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, one t : Teacher | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mgkxLrX6zFTYYT2LR", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-3 00:06:53"} {"_id": "Jm97tFLGXoMDeMoi6", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5myjcPjM43efNfDAg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 13:19:07"} {"_id": "rp3c9Wp7HaTMuPm5H", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Person | some c : Class, g : Group | c->p->g in Groups | some q : Person | q->c in Teaches implies q->p in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vypAAk7ME9mSdQeqM", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 15:50:43"} {"_id": "JRRXNh42z5meZbYRv", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^Tutors\n}", "derivationOf": "LWm3bqChmkH9GukiW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:47:25"} {"_id": "2vdKpi3oaCPcopaWi", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\n \t\n \tall c:Class,t:Teacher | lone c.~Teaches.t\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\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n \t\n}", "derivationOf": "cFaqh3riLKt4XjMKX", "msg": "This cannot be a legal relational join where\nleft hand side is c . ~ (this/Person <: Teaches) (type = {this/Person})\nright hand side is t (type = {this/Person})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 20:25:11"} {"_id": "hRuyawMYprhWxQXJf", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \n}\n\n/* No class 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZpLgbELcj9TS2zfhw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:35:34"} {"_id": "ZZEnYw7bCpWmJka2X", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall t : Teacher | t not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}\n\n", "derivationOf": "QGRRQj6NeQtrpsC8f", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-18 17:29:35"} {"_id": "w8bLgdSD9L5eFNwj2", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, x, y : Teacher | y->c in Teaches and x->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EqQ35KJ7EagNn3yoj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 17:39:28"} {"_id": "YziFnMAvB9mr7ER2T", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\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 Class in Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yLKenegu2zkdtX4qp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-3 10:33:04"} {"_id": "8cgj6QoKHqYJJmRRE", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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 in Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZpPCHijK8K9ujEB5h", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 17:58:38"} {"_id": "2N6et9MyMEiR2HDeQ", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall t : Teacher | t not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NcjiHSvGJwdSuL2wW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-18 16:48:34"} {"_id": "hsbdi95ZZtks7pDJJ", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | studentInClass[s,c] implies some p : Person | p->s in Tutors and p->c in Teaches\n}\n\npred studentInClass[s:Student,c:Class] {\n\tsome g:Group | c->s->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QYArRs2xmL4RnhGuk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:58:36"} {"_id": "w6Y3irr2stR3v82Tj", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Class | x in Group implies x in Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Person | x in Teacher implies x 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hovj9vSW3GiRwqa8G", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class}\nRight type = {this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:21:39"} {"_id": "tPa9bZSmPt4WermWo", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "E93urmFcYDhzp9YyD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 17:39:49"} {"_id": "QRo9Mkryt4nWqnrnL", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c:Class, p:Person, g:Group | p->c not in Teaches implies c->p->g not in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uMp5DnqQoZaBdKwWB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 17:51:04"} {"_id": "pgaKN4uDvHpDQiLAi", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "4wGPA7YWtsc9etgeq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 15:48:53"} {"_id": "j8HXqZx8yaQnQQvMY", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SQYpjpAtakKoyoFSp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:19:38"} {"_id": "CzDw6GjTm9rmisZZ5", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | c in t.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\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 | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | c->Person->Group in Groups implies Person in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7GW3T8ibyCKHZQRj2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-21 16:54:08"} {"_id": "cx3YEuvTtbtC8niBG", "cmd_i": 12, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall p1:Person | isTutored [p1] implies p1 in Student\n}\n\npred isTutored (p1:Person){\n\tsome p2:Person | p1->p2 in Tutors\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sHnoxFyWqpE4hqLjq", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-7 18:07:36"} {"_id": "mQGv8SAmaCwCBMCmL", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \t\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\t\n \t or p in Teacher\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eTNQzfGC6nHofa6LK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 18:16:46"} {"_id": "PysQK6n4kZc4YKojc", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class | all y : Students | x->y in Group \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eT7KB3AxauptG5ANt", "msg": "The name \"Students\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:37:46"} {"_id": "jaZuK4cqhw7GRpfBW", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall t:Teacher | t in Group \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HzYSaNm8vuNCABRFc", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:32:44"} {"_id": "GQBFHoso2w8oiDoLK", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n \tall p : Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | (some c : Class | t->c in Teaches)\n}\n\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | (some t : Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c : Class | has_groups[c] implies (some t : Teacher | t->c in Teaches)\n}\n\npred has_groups[c : Class] {\n \tsome s : Student, g : Group | c->s->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nivHQCYLv8okTwfbK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:43:38"} {"_id": "gZ3obLAxf3dq892Kb", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class , t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c,d:Class | t->c in Teaches and t->d in Teaches implies c=d\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8qqt6dC5hLAJkz6mN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:34:04"} {"_id": "HzPkZhF45RuZFQ5FE", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Teacher | some c:Class | p->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c:Class | t->c in Teaches implies one c\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t:Teacher,s:Student,c:Class | t->c in Teaches and t->s in Tutors and s->c not in Teaches\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mTXXAB8KK82frrdzW", "original": "YH3ANm7Y5Qe5dSYem", "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": "Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "Student:Person"}, {"parent": "Person", "type": "Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 222, "y": 199}, "Class1": {"x": 444, "y": 199}, "Class2": {"x": 666, "y": 199}, "Group0": {"x": 222, "y": 298.5}, "Group1": {"x": 444, "y": 298.5}, "Group2": {"x": 666, "y": 298.5}, "Person": {"x": 444, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}]}}, "time": "2019-9-30 08:44:06"} {"_id": "fNr5hoRLiYQoaGrGe", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Person, some c:Class | p in Teacher implies p->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yqkQWzP24v2qFPArs", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-28 21:46:59"} {"_id": "x5iaCKTbkaokPeKPL", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\nall t : Teacher | some g : Group, c : Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\nall x,y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\nall s : Student | (some t : Teacher | t->s in Tutors) implies s in Class\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cikCNz94ye5EvagZY", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:32:58"} {"_id": "M4waziYmD3HcG9WRM", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\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\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "qQKvYeBdP2pXaQscM", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:44:39"} {"_id": "yXBYto6xPtjXXExxS", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qHyyce8L6faXgWBYj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 15:08:42"} {"_id": "ksf7ERQuYZ3qogX3p", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LYSkhefs4NH7y2jih", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:21:56"} {"_id": "wgEG3cbPrzE84ewJn", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p: Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher some c: Class| t->c \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PDMpbGGAX3sePYBqp", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:31:18"} {"_id": "W5uWYe33b9hPXYn42", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qnxNRemor68CuSemJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:35:54"} {"_id": "9b3iNcikSFSfjoBF3", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches implies not t1->c2 in Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Df5wS5EKjPrBcEtjM", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:08:23"} {"_id": "EtBBkdRKFpinXY2Sn", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "pZdStqH9Gifwf2vys", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:17:32"} {"_id": "NvbfyA2jDAueXjcix", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nall x,y : Person | x->y 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fHm6Mdw334fKcfQQW", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:13:33"} {"_id": "Y9TswJWyYqfqeDrbG", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kGA3nRoneLFY59Y5N", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:30:04"} {"_id": "cBjckEKQGDGMWhnyQ", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jDAPNtJ5v5n4BmpvJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:11:39"} {"_id": "c2eAXTubo9cZ7A42c", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student|some t:Teacher, g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n\npred inv12 {\n\tall t:Teacher , s:Student | some g:Group ,c:Class| t->c in Teaches and c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p:Person | p in Tutors implies p in Teacher \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KTB69ZD9mPBJn3mLh", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:33:07"} {"_id": "nqNu9JNgC8icwMjg3", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n all x, y, z : Person | x->y in Tutors and y->z in Tutors and x != y and x != z and y != z implies z in Teacher\n}", "derivationOf": "uQCgDdJZh8z289BsT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 19:34:49"} {"_id": "nvCq3bZhnMgnYgLZW", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student,t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "o6XYroyJqe9wScfCx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 14:54:01"} {"_id": "DvJhY7GPbuTKYxXuJ", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n Teacher in (Teacher.Teaches).~(Teacher.Teaches)\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SMCXsdfK8ELLKR5vh", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 17:24:17"} {"_id": "hzvixZqx4k2b7BDQE", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "3zYwi7gJudeRRqM32", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-17 10:00:53"} {"_id": "XuqTpw7GwtbzeLZty", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7YxQMrcEn5bGSZhCt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 13:07:32"} {"_id": "u2byeCgqE2cDoZiNc", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class, s : Student, g : Group | c->s->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ohHEvLEjMPFtir5Jg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:37:27"} {"_id": "Fprz8GtxxGHLLFpu2", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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. */\n\npred inv11 {\n \n all g:Group, c:Class | some p:Person | c->p->g in Groups implies p in Teacher\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "q3rrjcboFmMRMGsSr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 14:30:52"} {"_id": "q8WvsHLEiucRiiXDY", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher | some y : Class, z : Group, v : Person | x->y in Teaches and y->v->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n\npred inv14 {\n all x : Person, y : Class, v : Teacher | (some z : Group | y->x->z in Groups) and v->y in Teaches implies v->x in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eKSxpJ2YFeoDspRew", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 15:51:17"} {"_id": "JXa3wptxpxTmxwKE9", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall t : Teacher | t not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some c : Class | t -> c 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Zd7TP6HftWeWeTLiM", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-18 16:59:50"} {"_id": "KzfCQ6k9YuEJHa6gF", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\tall p:Person | some p.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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qda7vzy3BcmESdv32", "msg": "This cannot be a legal relational join where\nleft hand side is p (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 11:24:38"} {"_id": "yrpzeKbrzv7Z39WqQ", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Jm97tFLGXoMDeMoi6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 13:19:48"} {"_id": "kCnQh8srronPsZveD", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all c : Class | some t : Teacher, g : Group | c->t->g in Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bA4uCN2uwn9dz3eGS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 12:55:53"} {"_id": "5D5Dt2e5x6yAStnG4", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome p:Person,c:Class | p in Teacher implies p->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher,g:Group | t->g in Groups\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qrorThtSLXr9TCeCy", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-28 21:38:15"} {"_id": "cikCNz94ye5EvagZY", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\nall t : Teacher | some g : Group, c : Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\nall x,y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Cep6gTFiKon4C7CKH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 11:30:32"} {"_id": "jmFXBTJpGsb9AC4W4", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QdAnuxpLtoMfoA68M", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 10:47:11"} {"_id": "F4GeM3LNPebYhZf6X", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 \t\n \tall c:Class |some t:Teacher | lone c.~Teaches and lone t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oBsAtHyAoNCjvNewX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:25:34"} {"_id": "LcjS9kgZzQSn6uA5L", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher, y : Class | some z : Group | y->x->z in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n some x, y, z : Person | x->y in Tutors and y->z in Tutors implies z in Teacher\n\n}", "derivationOf": "xa5FPaEoESQwqPEWN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 13:08:06"} {"_id": "qHyyce8L6faXgWBYj", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches implies not( t1->c2 in Teaches)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9b3iNcikSFSfjoBF3", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:08:32"} {"_id": "XL8SeNnoxtt6HYSHy", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c:Class | (some t1:Teacher , t2:Teacher | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KrcBHtebvda52Nykm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:00:23"} {"_id": "xt4ADbs3dC4xJhn5p", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Teacher | some c:Class | p in Teacher implies p->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "P38DmMXaJwmy5Dhde", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-28 21:47:54"} {"_id": "oiJvcoJ7RfNro8EDd", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher | some y : Class, z : Group, v : Person | x->y in Teaches and y->v->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n\npred inv14 {\n all x : Person | some y : Class | (some z : Group | y->x->z in Groups) implies all u : Teacher | u->y in Teaches and u->x in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GH37E8eyiq6As5mtm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:40:10"} {"_id": "uMp5DnqQoZaBdKwWB", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c:Class, t:Teacher, g:Group | t->c not in Teaches implies c->t->g not in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aKPFPPEJ8YG9uEviF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 17:50:21"} {"_id": "gbq5PByBkDtbKQex7", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FPqEfbMcyXjnetAbY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 21:16:35"} {"_id": "95jqy2FEK7FwuDErN", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nzDZeXD5wze6s2FET", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-4 18:04:25"} {"_id": "pdzZxMvm5533BSeKv", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "riCpAQea9wM6nmt9n", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-13 17:04:42"} {"_id": "9cvhDHsW4nCv6kccn", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class|some t:Teacher | t->c in Teaches \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "hPRKR3uB8CvyqEHxD", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:33:26"} {"_id": "EyD9fMN7xrScmtLCm", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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\tall c:Class | some Person.(c.Groups) implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zvGv7Ceyf57H472NE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 12:15:59"} {"_id": "QPxHSfkmSfqWnfHgE", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Person | x in Teacher and x in Group and x in Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Person | x in Teacher implies x 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "q4AmbviTjpk35oyjs", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:24:44"} {"_id": "ZMyhezj8kMg6gLzXK", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches and (no Student & Teacher)\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XDdLKo4Hy5F2GSqYy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:35:00"} {"_id": "gdnLhDqhKF3MKHj6r", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | some p : Person | p 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eBXJdoHnNpAd7JMEf", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:32:39"} {"_id": "hQnDA6JhEr9CjL4f6", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-1 09:38:38"} {"_id": "oXWk3FeeAfweWSR6L", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bau2GLtrpQ4bvaC3k", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-10 16:42:48"} {"_id": "HZX5jT6pX57CsKNZh", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tno Group.~(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "39xkjvdyEXDpztw3g", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:24:35"} {"_id": "ojEeWqGDwBx4tabj7", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher, c : Class, g : group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "owNExFgusRjXSDq7R", "msg": "The name \"group\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 11:32:22"} {"_id": "vQcK3r2SSeSsNJMEm", "cmd_i": 12, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\nall s,t in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "H6odbHQAzNs3chGK3", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 12:55:10"} {"_id": "H9nTsAQefQiTXipCy", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \talways (all p:Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ip94Rr9vX84krb93e", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 21:28:09"} {"_id": "s7xatd43jvokDu5Ex", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\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 s.(c.Groups)\n}\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.(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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "r4ythgR2tMaKj9us7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 12:07:50"} {"_id": "HhEA85bE9hWt6jehE", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gqkCZxEqKJC7Dj3qN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-10 17:26:54"} {"_id": "tWLTuPfppaA6hszsS", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tgWceDjMtpyPqLgHS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-2 23:57:08"} {"_id": "2F5bYFF7jQ9Mo66um", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "thQexJYx3EZ6be3Rm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-1 17:46:59"} {"_id": "GH37E8eyiq6As5mtm", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher | some y : Class, z : Group, v : Person | x->y in Teaches and y->v->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n\npred inv14 {\n all x : Person | some y : Class | (some z : Group | c->x->z in Groups) implies all u : Teacher | u->y in Teaches and u->x in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "s8BCMWGr77yGgxNhT", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 15:40:03"} {"_id": "3mHcZPPZZr3GSt2yN", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TAyRrSo5G79BKirhQ", "msg": "The name \"teaches\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 11:29:30"} {"_id": "4aGvdbRPZaZRzBsDh", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tno Class.~Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "ExdRi7We2SknueM8s", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 10:21:02"} {"_id": "97dXNrJZYvLq5NRmQ", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "PQjXeC2eCtEh3LJpy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-12-2 11:41:32"} {"_id": "p6PjDMQQLBA5Zijsr", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TAgJxsK8nFWi7TSmP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-10 16:59:18"} {"_id": "WAFjF2mo5ksMGm4dL", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher, y : Class | some z : Group | y->x->z in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n all x, y, z : Person | x->y in Tutors and y->z in Tutors implies z in Teacher\n\n}", "derivationOf": "LcjS9kgZzQSn6uA5L", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 13:08:40"} {"_id": "FaQmzKyGRYAPsNvSZ", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EX5pvfRiH9pqD3Adr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-4 19:54:56"} {"_id": "N6BdRci9X9HpedZJc", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class| some t:Teacher | some c.Groups.Teacher implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "wEqej3Ts9tnnxxJzH", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:01:41"} {"_id": "6HMPYhyLv2wzX6k69", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors \n}", "derivationOf": "2JwPBTb4Z9fgAhYFW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 09:56:48"} {"_id": "DtWbSPMhGSvLXZfMs", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 all c : Class | all s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (all t : Teacher | (t -> c not in Teaches)) implies (all p : Person, g : Group | c -> p -> g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hPicTur8shgLc3eHZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:09:33"} {"_id": "J8NjJqCHgctWCFdto", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher | some y : Class, z : Group, v : Person | x->y in Teaches and y->v->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n\npred inv14 {\n all x : Person, y : Class, v : Teacher | (some z : Group | y->x->z in Groups) and v->y in Teaches implies v->x in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wQAfEMNEuK8t9N3yC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:52:57"} {"_id": "3jgBESrxy5HMeG5qk", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class|some t:Teacher | t->c in Teaches and one s.(c.Groups) and one t.(c.Groups) implies t in s.^Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "tZFAYauifuYzrNfHZ", "original": "YH3ANm7Y5Qe5dSYem", "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": 222, "y": 199}, "Class1": {"x": 444, "y": 199}, "Class2": {"x": 666, "y": 199}, "Group0": {"x": 222, "y": 298.5}, "Group1": {"x": 444, "y": 298.5}, "Group2": {"x": 666, "y": 298.5}, "Person": {"x": 444, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "this/Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "this/Teacher:Person"}, {"color": "inherit", "type": "this/Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "this/Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "this/Student:Person", "visibility": false}]}}, "time": "2019-11-11 11:39:53"} {"_id": "i2t6XBtY8yvv7q48r", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dqEq2uTYqyCGKCWHd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:26:38"} {"_id": "YyJa2kBDCA4JLhZLq", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MWvdNiF7ZLqLuw9uH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 23:51:10"} {"_id": "MCZEA5xDRfnrmGzC9", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "trqCQfrGG64sjHbhe", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-10 14:52:15"} {"_id": "K7ufaNxN4CgZ4ap6J", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n \tall p : Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | (some c : Class | t->c in Teaches)\n}\n\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | (some t : Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "THnfuqsnCq5yeM6af", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:34:48"} {"_id": "ApwdL2Bq6duv5Smo2", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher, some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Td9oHbgvtD3nSbXJs", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-7 17:36:19"} {"_id": "i9FCMNeHaDFZEbxKK", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3fdmPpjbRg4Tpm9an", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 14:39:29"} {"_id": "ixf5XkzXXvJsr4btn", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eFu8ezQWymCXiGz9R", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:18:25"} {"_id": "dd6DWMoj4m6LwEhQF", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rkRh6GuJYaT8Z7J4D", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 12:15:59"} {"_id": "2ACxyScBiE8uGfbGZ", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t:Teacher | lone t.Teaches\n ~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n\n}\n\n/* No class 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AzGvrvo2mJqfykWWi", "original": "YH3ANm7Y5Qe5dSYem", "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": 623.0000152587891, "y": 132.66666666666666}, "Class1": {"x": 415.3333435058594, "y": 132.66666666666666}, "Class2": {"x": 166.13333740234373, "y": 265.3333333333333}, "Group0": {"x": 332.2666748046875, "y": 265.3333333333333}, "Group1": {"x": 498.40001220703124, "y": 265.3333333333333}, "Group2": {"x": 664.533349609375, "y": 265.3333333333333}, "Person": {"x": 207.6666717529297, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "this/Teacher:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "this/Teacher:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}]}}, "time": "2019-10-3 10:56:51"} {"_id": "SqsfJ8PkNioRcXrSa", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class , t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c,d:Class | t->c in Teaches and t->d in Teaches implies c=d\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 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\tall c : Class, t: Teacher | t->c not in Teaches implies not some s:Student,g:Group | c->s->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SGYDfr6Lp2J3D9cb9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:42:51"} {"_id": "v7v5KZrfZRYs6FnsP", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rBDtKs5uMj3BDnjqB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:29:38"} {"_id": "Nd8aqYS4hhf4ZuApD", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.^Tutors and t not in Person.^Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "izgEezbqeBwfviCgg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:10:09"} {"_id": "SPhWWd8aasWwtxLoR", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YSTRtJQFKQzycZDZ7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:26:18"} {"_id": "o2kBmvCveuK68h2fm", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "GY29xRqbv7rwLARwP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:55:20"} {"_id": "QHQ78Bvj9ELv4mBv6", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\t\n\n\n\t\n \n \n \tall c:Class,g:Group| some t:Teacher | t in c.Groups.g \n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "FLQFWbB4frQS35oSB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:25:23"} {"_id": "Ha99DPFqxqzvx8A2v", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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. */\n\npred inv11 {\n \n all g:Group, c:Class | some p:Person | c->p->g in Groups implies p in Teacher\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ycAWBqdNovk9gp6Xi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 14:30:37"} {"_id": "DW8FKp4XL6dm5gTNE", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "c48sShnRF4rYNmG8r", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-2 15:37:15"} {"_id": "qG29p6LRGvpxhHDHM", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\t\n all c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "bEhEGnWjriGmnMZtq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-21 10:58:05"} {"_id": "DrifMNkLZS64ini29", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class , y : Student | some g : Group | x->y->c 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4irm6LThE9oL4dAPC", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:42:55"} {"_id": "dBW7qQJhpCsBx3ZHt", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \tall p, q : Person, c : Class | (some g : Group | c->p->g in Groups) and q->c in Teaches implies q->p in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tsome p,q,r : Person | ((p->q in Tutors or q->p in Tutors) and (q->r in Tutors or r->q in Tutors) and (p->r in Tutors or r-> in Tutors)) implies (p in Teacher or q in Teacher or r in Teacher) \n}", "derivationOf": "EqTQdcJEvSvkDnZef", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 16:14:35"} {"_id": "DaFq9E76oiL5HLXYs", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches \n}\n\n\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QrLKNnc4o2PXCM9f2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-3 00:21:28"} {"_id": "g6rbsKv2rr79KNmR3", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n some t1:Teacher , t2:Teacher | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2 or (not t1-> and not t2->c)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XL8SeNnoxtt6HYSHy", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:03:07"} {"_id": "P55CBzRQR7AMqEAXH", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yyH9tcR5d5LGeLqhz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 12:54:06"} {"_id": "fTRPbWXziwKphAJoA", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some g:Group,t:Teacher | c->t->g in Groups implies t->c in Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "obRpWBuoKiJdBCSyr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 17:15:43"} {"_id": "LkSY5r92QdQWBNrJk", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \t\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\t\n \t or p in Teacher\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "n7iswmAMqgBQHF8X6", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:12:02"} {"_id": "NtbRHguMTtYRS6nmG", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yrpzeKbrzv7Z39WqQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 13:20:15"} {"_id": "HaKZK8o5wdXp7Roa7", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\tt1 -> ... -> tn not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Tvv6rpioZG3MYuedj", "original": "YH3ANm7Y5Qe5dSYem", "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": "Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "Student:Person"}, {"parent": "Person", "type": "Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 177.60000000000002, "y": 238.79999999999998}, "Class1": {"x": 355.2, "y": 238.79999999999998}, "Class2": {"x": 532.8, "y": 238.79999999999998}, "Group0": {"x": 222, "y": 318.4}, "Group1": {"x": 444, "y": 318.4}, "Group2": {"x": 666, "y": 318.4}, "Person0": {"x": 710.4, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}]}}, "time": "2020-1-18 16:48:08"} {"_id": "7oMTSShGxR5jj4Tno", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher | some y : Class, z : Group, v : Person | x->y in Teaches and y->v->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n\npred inv14 {\n all x : Person, y : Class | (all z : Group | y->x->z in Groups) implies all u : Teacher | u->y in Teaches and u->x in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3p33LchHXuxaFCvPp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:42:18"} {"_id": "BkB5JP6bRGpr9gTx2", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some g : Group, c : Class, p : Person | t->c in Teaches and c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WsDxiMtBbaKHhTBmZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-3 00:26:51"} {"_id": "gEqm42ZxKdqf4P9Fh", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\tall p:Person | some 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Qgnyv84CWPaEKxtWo", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 11:24:15"} {"_id": "LMKp9W3XTLskank59", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "C9eCQkS9RNSb943tq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 11:55:02"} {"_id": "iht99inQjma4vG2x4", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KaQZkckt88GoRWv3o", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:31:50"} {"_id": "CZHFgLjmksaMCBW5v", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher, c : Class | t->c in Teaches implies some p : Person | all g : Group | c->p->g in Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "c5Pk3H9zqrzjF6NM9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:18:54"} {"_id": "FZNm6KWWN2SRAnS2x", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | s in Class, g : Group | c->s->g in Groups implies some t : Teacher | t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "C7TXenbWwnBAXrz38", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 21:07:13"} {"_id": "BvYSriFMyMEy3Mkwf", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "E6hzJ8TQT8MnnZ5zc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 15:49:04"} {"_id": "cXKGQ5ZWMkcycf3sY", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "vAzjWB5XrQkKokWcG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-17 09:44:17"} {"_id": "DX4Ny3nxJXmZtdCve", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class,g:Group |some t:Teacher | some c.Groups implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "de2t78ncwqX4ebctG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 11:00:42"} {"_id": "gmmALo6piFikMLRXG", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall t : Teacher | t not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}\n\n\n", "derivationOf": "ZZEnYw7bCpWmJka2X", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-18 17:31:16"} {"_id": "XG3tfB68ZDBHJoYsr", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "vRvdiJsB3FnmuEfa9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-21 10:31:26"} {"_id": "Ftz58xCfYeGZcWn4d", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Person.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all c:Class,s:Student,t:Teacher, g:Group| some s.(c.Groups)->g and some t.(c.Groups)->g implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "Mc8KtSNRnXKdhW7Bf", "original": "YH3ANm7Y5Qe5dSYem", "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": 222, "y": 199}, "Class1": {"x": 444, "y": 199}, "Class2": {"x": 666, "y": 199}, "Group0": {"x": 222, "y": 298.5}, "Group1": {"x": 444, "y": 298.5}, "Group2": {"x": 666, "y": 298.5}, "Person": {"x": 444, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "this/Teacher:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "this/Student:Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "this/Teacher:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}]}}, "time": "2019-11-11 21:20:14"} {"_id": "KRGePDNfm7EXgbyoi", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | (some c : Class, p : Person, g : Group | c->p->g in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\tall s, t : Person, c : Class | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p,q,r : Person | (p->q in Tutors or q->p in Tutors or q->r in Tutors or r->q in Tutors \n \t\t\t\t\t or r->p in Tutors or p->r in Tutors)\n \t\t\t\t\t\t and (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "9GwZThyYpdoctS2vb", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 20:42:07"} {"_id": "Kv6vG76h5XiELWztg", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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. */\n\npred inv11 {\n \n all g:Group, c:Class | some p:Person | c->p->g in Groups \n \n\t\n \n \n \n \n \n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gPdwcSjHjgQuBqLqp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 14:28:52"} {"_id": "RXRKjMjBSMZ8qQAcQ", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rv9rnS2ps63jWhqAc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 11:20:25"} {"_id": "qv5i3BcFG2YvrpXmx", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2QrTAd3v2K8YtTSc7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-21 16:41:24"} {"_id": "PEkE4Q94DTc2J9QRX", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher | some y : Class, z : Group, v : Person | x->y in Teaches and y->v->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n\npred inv14 {\n all x : Person, y : Class, v : Teacher | (some z : Group | y->x->z in Groups) and v->y in Teaches implies v->x in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "s2Q833e9k4WeAG9LR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:44:24"} {"_id": "T3x3wz3DPW6SD3wdC", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "d2PhC2ygioCMBu2Tw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:29:40"} {"_id": "4kj6Pz8QbkTniLvH2", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class|some t:Teacher | t->c in Teaches and one s.(c.Groups) and one t.(c.Groups) implies t in s.^Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "ghPaj49BwkJoNZaPS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:38:58"} {"_id": "Nzt9MA7Cd5SXQ2hHK", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1,c2:Class,t:Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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->c->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LsJLox6zHzeDQtZL2", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person->this/Class->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:06:33"} {"_id": "Pdtp9RhdLe6RGdFy4", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher, y : Class | some z : Group | y->x->z in Groups and x->y 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Zxi3ZfYohw5C2uX56", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 12:34:25"} {"_id": "eaDEZC5zHeAP7qWLX", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\t\n \tall c:Class | no Person.(c.Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "9a3wEWm55TdvvYYfS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 16:25:01"} {"_id": "cPKhSq4CLjo8hbmsB", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c:Class, t:Teacher, g:Group | c->t->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xx8sqjBTqWMrPQ2n8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 17:53:26"} {"_id": "gk6GMC4JumL87ATWD", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\n \tall c:Class : one 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PvKLE8sZtjxPZ3RE4", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 19:05:31"} {"_id": "ogSfWwJ6Qoiao9Cuy", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* 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 Teacher) iff not (Person in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3spr4qhg7t9zgRouu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 21:19:55"} {"_id": "8o5zGk5D9vSEQ4BqK", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\nall t : Teacher | some g : Group, c : Class | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bHcHFSxhYXzPiYvRA", "msg": "The name \"p\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 11:27:55"} {"_id": "SQWjdhcvExczPzEH9", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher|c:Class | lone t in c.Groups.Group\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n \n \n all c:Class,s:Student,t:Teacher,g:Group| c->s->g in Groups and c in t.Teaches implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "gMnqzHiZHYjMqHX6T", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 13:04:11"} {"_id": "oKjJRzxnG6vWPJxZY", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n \n all c:Class,s:Student,t:Teacher, g:Group| some s.(c.Groups)->g and some t.(c.Groups)->g implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "ShKX2pNPRb3KGMbZA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 21:17:50"} {"_id": "GKm6vj8KJL6oeo5x2", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "nkbEhXPd8BLoSKCqu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-21 10:31:43"} {"_id": "eX5AeqkhaiCjohtgR", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \tClass.~Teaches.Teaches in Teacher.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6Q6GY2c5xcy3a3uxQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-4 18:43:46"} {"_id": "M7DwJ7m8DTiEQEzBs", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8Ri5xaRN9P8L3GACL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 23:44:32"} {"_id": "eNtLffa39nKgwZLff", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MQKyRdCxLTejLJBCp", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 10:32:06"} {"_id": "fe4nSRywfmWc7rhxZ", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \tall p, q : Person, c : Class | (some g : Group | c->p->g in Groups) and q->c in Teaches implies q->p in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p,q,r : Person | (p in Teacher or q in Teacher or r in Teacher) implies (p->q in Tutors or q->p in Tutors) and (q->r in Tutors or r->q in Tutors) and (p->r in Tutors or r-> in Tutors) \n}", "derivationOf": "jqXPZugyFfHhazzeE", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 16:07:27"} {"_id": "7tT63rBPiD6ToF7wP", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, p : Person, g : Group | c->p->g in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\tall s, t : Person, c : Class | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p,q,r : Person | (p->q in Tutors or q->p in Tutors or q->r in Tutors or r->q in Tutors \n \t\t\t\t\t or r->p in Tutors or p->r in Tutors)\n \t\t\t\t\t\t and (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "oYZ9APKCMvDqsWPyS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 20:44:44"} {"_id": "4QYiQfWhMGHvC66Fa", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher, y : Class | some z : Group | y->x->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Tt8KMXkmWafyLmGqP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 14:47:21"} {"_id": "ENDZbcC2rqQp2MpjK", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JZtGouSwFWJTWspwW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 12:53:54"} {"_id": "gRBuoQrx5XHwztoqs", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YyJa2kBDCA4JLhZLq", "msg": "The name \"teaches\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 23:57:02"} {"_id": "GmFX4oCmgCL6Kou55", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n id in (Teacher.Teaches).~(Teacher.Teaches)\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DvJhY7GPbuTKYxXuJ", "msg": "The name \"id\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 17:24:58"} {"_id": "tmNgNNaCfgMomSRJm", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher, c : Class | some g : Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kMfG6grjFax3T4X9h", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-3 00:25:03"} {"_id": "iJRDtfM2Hqs3SZZgd", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "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": "Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "Student:Person"}, {"parent": "Person", "type": "Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 177.60000000000002, "y": 238.79999999999998}, "Class1": {"x": 355.2, "y": 238.79999999999998}, "Class2": {"x": 532.8, "y": 238.79999999999998}, "Group0": {"x": 222, "y": 318.4}, "Group1": {"x": 444, "y": 318.4}, "Group2": {"x": 666, "y": 318.4}, "Person0": {"x": 710.4, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}]}}, "time": "2019-9-26 12:50:35"} {"_id": "uvd2odYcZnGcd6rut", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Teacher | some c:Class | p->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c:Class | t->c in Teaches implies one c\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t:Teacher,s:Student,c:Class | t->c in Teaches and t->s in Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bzijHZdFt468TYTBj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-28 22:09:04"} {"_id": "TFxzjEb9edJosBBYj", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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. */\n\npred inv11 {\n \n all g:Group, c:Class | some p:Person | c->p->g in Groups implies p in Teacher\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GHjCvgtC5dS4fsWH4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 14:30:48"} {"_id": "P38DmMXaJwmy5Dhde", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Person | some c:Class | p in Teacher implies p->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WALDKH6qhiDhJDAbA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-28 21:47:28"} {"_id": "bJe6gJAdjBMWWjKgz", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class,g:Group |some t:Teacher | some c.Groups implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mLjQuB9ciPa9CZTzm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 11:00:37"} {"_id": "a6dbj9xTpzC5Q6WRA", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some g : Group, c : Class, p : Person | t->c in Teaches and c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BkB5JP6bRGpr9gTx2", "original": "YH3ANm7Y5Qe5dSYem", "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": 286.08331298828125, "y": 199}, "Group": {"x": 286.08331298828125, "y": 298.5}, "Person0": {"x": 190.72220865885419, "y": 99.5}, "Person1": {"x": 381.4444173177083, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "this/Teacher:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "this/Student:Person"}, {"color": "inherit", "type": "this/Teacher:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "this/Teacher:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}]}}, "time": "2019-11-3 00:27:05"} {"_id": "ozKr2xJZTFXcc7E9w", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors \n}", "derivationOf": "QvhsooYb2syudMJip", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 09:56:14"} {"_id": "dCJ8HXTZBNhSKpiGR", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "n8zvJ2bgEXwQttsGY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-13 17:03:41"} {"_id": "ibcvLbvWKoWjWax3c", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t all c : Class| some t : Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n }\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some g : Group, t : Teacher | c->t->g in Groups) implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "f4tNh8q8xRucRAAga", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-9 00:30:46"} {"_id": "yeb4danEbSTkThyia", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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 all c:Class,g:Group | some p:Person,t:Teacher | c->p->g in Groups\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "CoHhu7G9Gs4qrkCqA", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:49:15"} {"_id": "4bwJ9auugBoRwgihE", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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\tall c:Class | some Person.(c.Groups) implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WtpYmrhsNTfS5Hzof", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 13:22:36"} {"_id": "yMeEKSybsfgwbrZyW", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "cf72ZcjKoeMD7kuK7", "original": "YH3ANm7Y5Qe5dSYem", "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": 296, "y": 199}, "Class1": {"x": 592, "y": 199}, "Group": {"x": 444, "y": 298.5}, "Person": {"x": 444, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "this/Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "this/Teacher:Person"}, {"color": "inherit", "type": "this/Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "this/Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "this/Student:Person", "visibility": false}]}}, "time": "2019-11-13 17:03:25"} {"_id": "CM2DLMaxK8x85sLjT", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n \t\n \tall c:Class | some t:Teacher | some c.Groups implies c in t.Teaches \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "ooF3ahKJhAAhTZbk4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 11:50:16"} {"_id": "oJ2p3MeYczn3WEGG9", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "p5XR4ty2wovw4Wbvi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 10:21:00"} {"_id": "qBCQsGXf2RDvykRFu", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some q,r : Person | (p->q in Tutors or q->p in Tutors or q->r in Tutors or r->q in Tutors \n \t\t\t\t\t\t\t\t\t\tor r->p in Tutors or p->r in Tutors)\n \t\t\t\t\t\t\t\t\t\t\timplies (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "xDAwe6Xg778j8C2uN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 20:29:36"} {"_id": "mHbnvfgTAFBgRpsZT", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student,t:Teacher | s.(c.Groups) and t.(c.Groups) implies t in c.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "zWXq9Xki4G29NQiPs", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 14:53:03"} {"_id": "zAXhhyLbhv8ApXpmT", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\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\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "GnnFBfEs8fkR8vPFw", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:46:14"} {"_id": "QYArRs2xmL4RnhGuk", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher,c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "v9XaS5BHS8WtMfRdw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:42:54"} {"_id": "7BdaW2WQopXbDy9x7", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wgzPbwANMj3uTFLo3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:36:43"} {"_id": "EzcNSLrMXEajHBjEx", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BDQMqmxYmYu35tB8s", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 17:18:08"} {"_id": "rNdgw9c7gLXZtWeBx", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class,g:Group |some t:Teacher | some c.Groups implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "TM6izgocYLvSCjGwz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 11:01:09"} {"_id": "wPwem6HEnp29J54P5", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class,g:Group|some t:Teacher | some c.Groups.s\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "v25hW3uM4eMw45rxd", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:35:02"} {"_id": "Q3QMMxatSmjGwTeRn", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:09:11"} {"_id": "4j5BwoHqps8kSTTPE", "cmd_i": 2, "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all P in Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tQATbnA9EHwRSvtbz", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 10:34:27"} {"_id": "pD7KXz2xkfK2XyWb8", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | c in t.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\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 | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some p:Person | c->p->Group in Groups implies Person in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CzDw6GjTm9rmisZZ5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-21 16:54:32"} {"_id": "y96jH95jqHP4gzNai", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bP3KPpMvsMywxs35r", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-1 18:08:46"} {"_id": "atwJ6DgQB8BFo2Rit", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class , t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c,d:Class | t->c in Teaches and t->d in Teaches implies c=d\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 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\tall c : Class , t: Teacher | some p:Person,g:Group | t->c in Teaches implies c->p->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "NQL9cnNe9o3DAAgvP", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:55:44"} {"_id": "pmPSmvLFryXbiTivt", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "oifBkPyMS4sZ8YRPb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:18:15"} {"_id": "Xaev7ba8EDfE7vSrZ", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | (all g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WF8Cf8wZCveAzDYoa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 12:52:23"} {"_id": "9GwZThyYpdoctS2vb", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s, t : Person, c : Class | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p,q,r : Person | (p->q in Tutors or q->p in Tutors or q->r in Tutors or r->q in Tutors \n \t\t\t\t\t or r->p in Tutors or p->r in Tutors)\n \t\t\t\t\t\t and (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "MfjWHaXND2jdiENNL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 20:39:47"} {"_id": "PJXw5duz7ANf2Z7Jh", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xkwpy4CcN29foF4f4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-1 17:29:08"} {"_id": "hoMgKh9DokKJpDxpZ", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "cc38q8u4H2mfKdcCT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 12:47:23"} {"_id": "jLNL5wk5GmdqAno5F", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some s : Student, g : Group, t : Teacher | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "k4avT8z9Y5QXfDjgd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:47:05"} {"_id": "CFKg3Mqgkb2xA8pcC", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class,g:Group|some t:Teacher | t->c in Teaches and some s.(c.Groups) and t.(c.Groups)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "Lm8mDgKpSLmYTmDXJ", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 11:36:16"} {"_id": "sa8ne94vpQpfeAko5", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class , 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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "3appas8mTCoN2EE29", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-1 18:26:20"} {"_id": "edsXMPzAvSdGEyjMJ", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall p1:Person | isTutored [p1] implies p1 in Student\n}\n\npred isTutored (p1:Person){\n\tsome p2:Person | p2->p1 in Tutors\n}\n \n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PteDGa3sxgqKDuiNm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 18:10:06"} {"_id": "3JS4dYHWcP9Kuh2eE", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,t:Teacher,g:Group | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "GGZCTSkQYZbzLJcbF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:22:08"} {"_id": "XXAdiMCsKb5HejDXC", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZeQBXhpqWZCCtEjEP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 13:17:30"} {"_id": "ZC8o96euEg3DnbAb8", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "JZwhgAWCimcnCM6fn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:18:09"} {"_id": "XNExMMAp9TDA52FDN", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlone Teacher.Teaches.Class \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iENzjbNKbzf2w5mo5", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 17:46:29"} {"_id": "6T5CAG6gvn5pDTKGp", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "YoT7XzPQzDkE2xsEL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:39:12"} {"_id": "2hpTS6XRXKpn4gehb", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some g:Group,t:Teacher | c->t->g in Class implies t->c in Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "g6WRrwT6ofpEp82LT", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 18:46:24"} {"_id": "rNiGFWu8SRxjZry4G", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DpY3ivrAr6rdDHoCx", "msg": "The name \"teaches\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-2 23:53:09"} {"_id": "ohKZuGTBYkFjNWsWd", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t :Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8SopgjWR74WmW8cS2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:50:01"} {"_id": "iSkqCc4BAMRo9gNKt", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group,p:Person |some t:Teacher | c->p->g in Groups implies c->t->g in 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\tPerson.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "3QuTMeFTmYGLxiQa5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 10:52:46"} {"_id": "jQkpGTcpx8KbY68ZQ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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 t : Teacher | ((t -> c not in Teaches) implies not (some p : Person, g : Group | c -> p -> g in Groups))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2XaG3gfCp3dHrEaLF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:03:55"} {"_id": "RySuqXSxcHN2TKtRs", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher | t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | p.Tutors.Tutors.Tutors implies p in Teacher\n}", "derivationOf": "szgvE2u9qXMhupKhZ", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 21:26:12"} {"_id": "8HS6Y7HQxcTajafeG", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall p:Teacher | some c: Class | (p->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KiNCRskiAZX82LoXq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 10:44:41"} {"_id": "9SdZQbnFmDh73YFKJ", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 18:23:41"} {"_id": "GABJ4Nvn4GbjskA4d", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\tno some 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TfznC5aYz6QQySXPf", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 17:55:37"} {"_id": "MDQYrnf5gYJQCtXZB", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeaches in Teacher some -> Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tTeaches in Teacher -> lone Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-24 09:31:42"} {"_id": "ah22yhZ8Dz5hLukzj", "cmd_i": 12, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, g : Group | c->t->g in Groups \n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sAe8saByFuAT352J2", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 11:38:12"} {"_id": "pGvdNo8rywDNkEafT", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class,t:Teacher | s in c.Groups.Group and t->c in Teaches implies t in s.~Tutors\n\n }\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "uvoqqmHC3czboYHvL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-12-2 11:45:57"} {"_id": "75ecJRwE4zSL3rbe3", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class |some g:Group,t:Teacher | some c.Groups implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qKpDHdd6jWQ8pg4ot", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:58:06"} {"_id": "j4ZpzKcfrx9dhNdYA", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class | t->c in Teaches implies (some p : Person, g : Group) | c->p->g in Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mDBA7oafY6NHWYxv4", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 11:13:19"} {"_id": "zvGv7Ceyf57H472NE", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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\tall c:Class | some Person.(c.Groups) implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fNSiTf4nrLvWLcXgz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 12:15:19"} {"_id": "r4LyM8LAoP4Boz65A", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student | s in c.Groups.Group\n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "Hk5LZQeyhixosXG8C", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:53:57"} {"_id": "DvAhe4ySPTPg6dJ9K", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, g : Group | c->t->g in Groups and t->c in Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "89sJw8EcM2venQSdc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:02:20"} {"_id": "SuLNadCvihzzdQYes", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\nall p : Teacher | some c : Class, g :Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AZv3nyFweq5ceAYJA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:12:40"} {"_id": "bZtujdZ392ARtzyLs", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xxKPE3ZoysF8WHd9P", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-1 17:26:53"} {"_id": "TFtywMFg2aj8bGvNo", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student,s:Teacher |some g:Group,t:Teacher| s in c.Groups.Group and c->t->g in Groups \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "d9jJzaZdPNRqYki82", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:56:13"} {"_id": "uqYb5owXYqTdjCE8j", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher, some c:Class,g:Groups | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "XF5D9t7Wsiuvk4vjf", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 20:55:35"} {"_id": "hPicTur8shgLc3eHZ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 all c : Class | all s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all t : Teacher | (t -> c not in Teaches) implies (all p : Person, g : Group | c -> p -> g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AnezJgGgaJoaeNvXE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:08:40"} {"_id": "9ndKqdnus87i6meLg", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \n \t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tall c:Class, t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HbGwrvnZgBvbPAc6z", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-2 15:48:49"} {"_id": "3F3jvZvopi5rkpSMT", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 10:27:27"} {"_id": "GCaqxTkSrSKNtREcs", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 all c : Class | all s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all t : Teacher | (t -> c not in Teaches) implies not (some p : Person, g : Group | c -> p -> g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "47Y8sdAAfHLcATis5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:04:20"} {"_id": "qA3S7yDfHpewoKeMq", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome t : Teacher | t in Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "q8DDFA74k5Q9XLB4B", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:09:18"} {"_id": "sAe8saByFuAT352J2", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, g : Group | c->t->g in Groups \n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6HGghxEBH4Xw8k9mb", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 11:37:44"} {"_id": "8qqt6dC5hLAJkz6mN", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class , t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c,d:Class | t->c in Teaches and t->d in Teaches implies c=d\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "difX2WKCyZ8uPrqQ9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:33:58"} {"_id": "zZZbvqkdmNbmqokvi", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some t : Teacher | some s : Student | some g : Group | t->c in Teaches implies c->s->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qjKYPaQcvSeoMe2KH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:28:10"} {"_id": "QY4kZRdJPNrw5MAdX", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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 s:Students, 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\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "vdQoYHfmwCCWRncHQ", "msg": "The name \"Students\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:49:59"} {"_id": "byby3N48QZBFx2eyh", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ThWWqyEnW4fojd8Kt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-1 09:54:44"} {"_id": "6GYf5xZKjDpmuRBkA", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Teacher | some c:Class | p->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c:Class | t->c in Teaches implies one c\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t:Teacher,s:Student,c:Class | t->c in Teaches and t->s in Tutors and not s->c in Teaches\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uvd2odYcZnGcd6rut", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-28 22:09:52"} {"_id": "JZwhgAWCimcnCM6fn", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "2WTmFMoeu434e3ipk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:18:06"} {"_id": "2bJwfuhKoMWg2he5F", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \tall p, q : Person, c : Class | (some g : Group | c->p->g in Groups) and q->c in Teaches implies q->p in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tsome p,q,r : Person | (p->q in Tutors or q->r in Tutors or q->r in Tutors or r->p in Tutors or p->r in Tutors or r->q in Tutors) implies (p in Teacher or q in Teacher or r in Teacher) \n}", "derivationOf": "mTfCzd4ate3SizjJN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 16:17:04"} {"_id": "RexNL9Gy4fakCsLj8", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,g:Group,t:Teacher | c->t->g in Groups implies t->c in Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mRcSrYxAB8pB5JEgy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 18:48:21"} {"_id": "TkZr2ZdXH3ntJRfwd", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \t\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tall s:Student | s not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "u8QeGy8NEvZMc7Gpr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 18:05:23"} {"_id": "e7BjE52mPxp9NdwC8", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class, g : Group | c->s->g in Groups implies some t : Teacher | t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "X4PtjK7fRYJnNpRmX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:12:01"} {"_id": "d2PhC2ygioCMBu2Tw", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pz3jn94TpGMjMf2Rk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:28:46"} {"_id": "BFnEmFfdBTCdFgZDi", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t1:Teacher , c:Class | t1->c in Teaches or not t1->c in Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "W6vbicRpgQafj8e2P", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:06:43"} {"_id": "cqbLqJyTduiMgEf8k", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\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\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GheD7WHKWDFp65yJB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-4 20:01:06"} {"_id": "BScFapefTHZTDH9C9", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, g : Group | c->t->g in Groups \n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ah22yhZ8Dz5hLukzj", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 11:38:17"} {"_id": "8CQTzeSZBFgAFnwkG", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \tClass.~Teaches.Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bs2ioB2rAijscemhc", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class}\nRight type = {univ->univ}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 18:12:39"} {"_id": "qW6wMMjPce2kCbCNd", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "rMNa7JesKfCj4kQcJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 20:52:38"} {"_id": "CsCPShXkBHqz2gBTM", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vYSSX7zBeRSZWLKRx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-30 18:18:19"} {"_id": "PyZiYzken5kHLP9CX", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n \n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TGahc7yGWBm2XRhvZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 10:45:47"} {"_id": "RrQ86tAzcwodcyCYG", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \t\n \n \t\n \tall t:Teacher | some c:Class,g:Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "QybxSMTjPundbwvJi", "original": "YH3ANm7Y5Qe5dSYem", "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": 666, "y": 132.66666666666666}, "Class1": {"x": 444, "y": 132.66666666666666}, "Class2": {"x": 177.60000000000002, "y": 265.3333333333333}, "Group0": {"x": 355.2, "y": 265.3333333333333}, "Group1": {"x": 532.8, "y": 265.3333333333333}, "Group2": {"x": 710.4, "y": 265.3333333333333}, "Person": {"x": 222, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "this/Teacher:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "this/Student:Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "this/Teacher:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}]}}, "time": "2019-11-8 10:30:14"} {"_id": "6e755ecbFMjapw4C4", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "baTw2Losy7oGNa8ZG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 13:10:41"} {"_id": "Pu2RkztsXZAiiYQ4H", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qupbKB7J7SKYQWvv5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-10 18:08:26"} {"_id": "E5N4oCFjPZSuwmj4A", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2W2KLPHebxZKAeTMo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 20:59:13"} {"_id": "Eu5gf2pCRmEZrSkYW", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (iden & Teacher) in (Teacher.Teaches).~(Teacher.Teaches)\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZEwXfGY7qB94qTYc2", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {univ->univ}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 17:25:14"} {"_id": "sW9WwcnmMbAi8oGWA", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some t : Teacher, c : Class | t->c in Teaches implies t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6qKcP3enB55nguomH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:27:49"} {"_id": "iahHaBt4XAxTYYqMa", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , g:Group | all s:Student | s in Class and s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JejMHXs9mwhtKmYNk", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:17:00"} {"_id": "L7dpEP4z6Hv4BwgiN", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BDXewisBMwdzpSAGm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 14:44:49"} {"_id": "mSricdB8DuvEZ7B5v", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ravbDSJ96nd5ZYu5k", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:24:17"} {"_id": "WhSydjxvsgZwpmTe3", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class, g: Group, s: Student | some t: Teacher | c->s->g in Groups implies (t->c in Teaches and t != s)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | some g: Group, c: Class | (c->t->g in Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p:Person, p2: Person | p->p2 in Tutors implies (p in Teacher and p2 in Student)\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "q6JWWe9apTHYE8zTJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-30 22:36:54"} {"_id": "Axx7CyqF9BdegHvNr", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \t\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\t\n \t or p in Teacher\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mQGv8SAmaCwCBMCmL", "original": "YH3ANm7Y5Qe5dSYem", "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": 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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "this/Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "this/Teacher:Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "this/Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "inherit", "type": "this/Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "this/Student:Person", "visibility": false}]}}, "time": "2019-10-12 18:17:47"} {"_id": "bPW8AhB5xcCL6zuMC", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | t in Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zbHxpc5jjtWGYDqKq", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:40:18"} {"_id": "BEdy4ZJD5ZrZ69vcH", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class,t:Teacher | t->c in Teaches and one s.(c.Groups) and one t.(c.Groups) implies t in s.~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "ZwvFWxzL9qtQi9HKr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:38:25"} {"_id": "Xotbz8jyjRtqwQfkM", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tall c:Class | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "95jqy2FEK7FwuDErN", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 18:06:26"} {"_id": "AhiEkMK73ffJPt25s", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1,c2:Class,t:Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c:Class | some g:Group, t:Teacher | t->c in Teaches implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LeNXJ34edC7tT95fT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:11:10"} {"_id": "XFF9EpikQgdeHgzwh", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hgKsGaRptAtdLkRK7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-10 14:50:09"} {"_id": "okP6ofShHnif7ZRq3", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tTeacher.Class\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Pu2RkztsXZAiiYQ4H", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 18:27:15"} {"_id": "fmfPmZpKnNSGcNDax", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student,t:Teacher | some s.(c.Groups) and some t.(c.Groups) and t->c in Teaches implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "oz3TGdSbzenq3g8yM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 14:55:16"} {"_id": "E52BQrXn68oaK8k5E", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n some t1:Teacher , t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2 or (not t1->c and not t2->c)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "v2T7GDsa2E5kkMaBG", "msg": "This expression failed to be typechecked line 82, column 103, filename=/tmp/alloy_heredoc14768496067717922579.als", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:03:52"} {"_id": "SWkxWJTt3zcnyhutf", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FGiDJqJ93YdC6hvLM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 13:11:28"} {"_id": "mHRwmDtjgTZwv4hFx", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gmZLJ2Geur2PJ2K5B", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:24:30"} {"_id": "eTNQzfGC6nHofa6LK", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \t\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\t\n \t or p in Teacher\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n\t\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fiSwWbPBr9Kxo8f5g", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 18:15:21"} {"_id": "QGRRQj6NeQtrpsC8f", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall t : Teacher | t not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p : Person | some c : Class | p -> c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}\n\n", "derivationOf": "gQPEXHmdEnYAEhTMJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-18 17:28:51"} {"_id": "DjvPmXrCoCfNZFn6s", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\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\t\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "QY4kZRdJPNrw5MAdX", "msg": "The name \"s\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:56:57"} {"_id": "v2KuPo8LXDSKbPuty", "cmd_i": 4, "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher, some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hn83iDziKK864Wrpo", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 10:54:15"} {"_id": "hy7nxr9KwAkFjfTCT", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6hTwZYr6i3tsRXoAe", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 12:03:28"} {"_id": "FxijjJzaPtm88hrPX", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3TqPuqHYMkvxKX8xH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:08:15"} {"_id": "v233gjBY322Ns6ZCa", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "hzvixZqx4k2b7BDQE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-17 10:01:11"} {"_id": "wHPpBGFhLvnSNc74n", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class,t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "C99QR9QPCMGMkZQPM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:27:31"} {"_id": "ev3EC9Eq7yPTmWjQy", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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. */\n\npred inv11 {\n \n all g:Group, c:Class | some p:Person | c->p->g in Groups implies p in Teacher\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fwCuLS2W36ixAtpHP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 14:30:44"} {"_id": "kKfEfx6S9JnY5cCfn", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cs9e9XGA3npCoc2Wo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:31:24"} {"_id": "HbGwrvnZgBvbPAc6z", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \n \t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tall c:Class, t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n \t\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vjWLw9f9bjBqKyJiK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-2 15:48:16"} {"_id": "EX5pvfRiH9pqD3Adr", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\n \tall c:Class,t:Teacher| lone c->t ~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vyC99MsgpnNECSAS8", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 19:06:18"} {"_id": "keJDTsEf6Ypoq6TcY", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some q : Person, t : Teacher | t->p in Tutors or (q->p in Tutors and t->q in Tutors) or (t->q in Tutors and q->p in Tutors and r->t in Tutors)\n}", "derivationOf": "Dzrsju4fkR38zB7pS", "msg": "The name \"r\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 07:08:47"} {"_id": "fA9Cgp6FBCsi4sx7K", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeaches in Teacher some -> Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tTeaches in Teacher -> lone Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MDQYrnf5gYJQCtXZB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-24 09:31:47"} {"_id": "SD6BN4doypndh3kRX", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome p:Person,c:Class | p in Teacher implies \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher,c:Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5D5Dt2e5x6yAStnG4", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-28 21:40:40"} {"_id": "nYpFGPJ3ayedQXe2o", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oR6bNauSYgNfvHWgt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:29:51"} {"_id": "KF4ntyW5hCm97PWoz", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student|some t:Teacher, g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n\npred inv12 {\n\tall t:Teacher , s:Student | some g:Group ,c:Class| t->c in Teaches and c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1:Person, p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class , t:Teacher, s:Student, g:Group|(c->s->g in Groups and t->c in Teaches) implies t->c in Tutors\n}\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "X8Z3FGy6LtCSTeq5J", "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": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:40:11"} {"_id": "hP8APmyBESf59ddKu", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher in Teaches.(~Teaches))\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "a8dpxf8cZETirhsWi", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 21:38:02"} {"_id": "z639op94MrSLAaMMb", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gjn7ycQkjz88wTkXN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 17:28:25"} {"_id": "7hmqLiPKTPpHSEHBA", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6n9EjwoxXutjty3P7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:32:15"} {"_id": "aaQZ6xA5ZPLKD86yi", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher | t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "uiYwbyaDTqu88AHJ9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 21:28:08"} {"_id": "XASC6k6twHCgkDeyd", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "H4kZeiHczhsSpm5JN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-1 18:00:42"} {"_id": "fXdkwbYgMBhBApWd2", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\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\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student \n}\n\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student, c:Class, g:Group | some t:Teacher | (t->s in Tutors and c->s->g in Groups) implies t->c in Teaches\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oTxY5Q2wXZLhFSERt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 00:14:03"} {"_id": "YmPaaJbtAu4xoiMmr", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "mmoWShZ4P5dFeaNrc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 10:17:56"} {"_id": "WaD498bvtaN8wPoYv", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tStudent.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FxKFnoyE9byPu3Q8j", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none->none}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 19:56:00"} {"_id": "F472bnac5eRoAw6hd", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\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\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HmLyiepCpxMfdchhe", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-28 21:48:06"} {"_id": "NhdMSxSZn3M9fhp2d", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student, c:Class,t:Teacher | s in c.Groups.Group and t->c in Teaches implies t in s.^~Tutors\n\n }\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "hGXNv68aCRwXiYatZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-12-2 11:47:32"} {"_id": "7Pn5k5zQ5Fg9P36gs", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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, t : Teacher | (t -> c not in Teaches) implies (all p : Person, g : Group | c -> p -> g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JYsZ2bK7DjqkmavRE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:07:31"} {"_id": "TM6izgocYLvSCjGwz", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class,g:Group |some t:Teacher | some c.Groups implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pN89HezGHdCiQ7M2c", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:00:51"} {"_id": "vmtfsj4Tg26M56ok3", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some s : Student | all g : Group | c->s->g in Groups implies (some t : Teacher | t->c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dYyajHWqAwmjEM6SS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:35:23"} {"_id": "RMntYrERY2vncb6QG", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher | some y : Class, z : Group, v : Person | x->y in Teaches and y->v->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n\npred inv14 {\n all x : Person, y : Class | (some z : Group | y->x->z in Groups) and all u : Teacher | u->y in Teaches implies u->x in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QDdZ7AdCBKdxaB44n", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:43:25"} {"_id": "4a5QyxtpQLsT6yHew", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group,p:Person |some t:Teacher | c->p->g in Groups implies c->t->g in 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\tPerson.^~Tutors in Teacher\tand Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "iSkqCc4BAMRo9gNKt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 10:53:12"} {"_id": "fp3uHgem8PeCfu5yg", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | c in t.Teaches\n}\n\n/* Teachers are assigned at most one 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hvJm48m2GEbWbvsCe", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-21 16:47:39"} {"_id": "Lm8mDgKpSLmYTmDXJ", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class,g:Group|some t:Teacher | t->c in Teaches and some s.(c.Groups) and t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "EHGAwbAXRJgh4bpzw", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 11:36:10"} {"_id": "4qzCDuYKBA7StwExY", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c : Class | some p : Person, g : Group, t : Teacher | c->p->g in Groups implies t->c in Teaches \n}\n\n\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BDxm9WubTiE7aeppY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-3 00:22:05"} {"_id": "7sLe6xQ3veHqrfffA", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\talways (no Teacher)\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\talways (some t:Teacher | (all c:Class | t->c in Teaches))\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "F8LSacSFvsgqJbQdm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 21:50:27"} {"_id": "GtjrCpw7MpJmgC45i", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "JimdunE7Wmc636zPc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-17 09:44:09"} {"_id": "RNAeYLEJM9jQ4WHp2", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "i7HJKMZrX34A9qnMb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 10:13:39"} {"_id": "8oyuWmFkfqfdijn9W", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Person\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 14:56:00"} {"_id": "xgucg94huXK7MNXTq", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tClass.~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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Xotbz8jyjRtqwQfkM", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 18:06:46"} {"_id": "FeAMjafjgkTJP5JAc", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "xv642Jf48e6P5MsSq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-13 16:58:40"} {"_id": "cLoEASkwiGQmWqydQ", "cmd_i": 6, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "htkfSNmAxDif5Ynxk", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-13 16:10:18"} {"_id": "tskoDjp5orBoBKsr2", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, g : Group | t->c in Teaches and c->t->g in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AqPcciqedh7fWbuso", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 20:55:48"} {"_id": "wfpuhhWZhdFGSzW6J", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZvFPea9weDDEJTuSN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-13 16:10:53"} {"_id": "a3MnwqnjG4iPMMM5w", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | one c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches impplies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BcwhDtze5qGgYJmoR", "msg": "The name \"impplies\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-3 00:01:57"} {"_id": "dmDeKQ6wiHCHTZi4H", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \t\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\t\n \t or p in Teacher\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "P8uXkCKuoYikjWeXx", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:09:06"} {"_id": "4X3g7wajuBtAonbW4", "cmd_i": 12, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t(no Student & Person^(~Tutors)) and (no Teacher & Person^Tutors)\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "eqbK2c9NxuSnKbkAz", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 09:53:31"} {"_id": "S5Pf4FGKELajeMbTQ", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bfjN4PmRXP9YK8sat", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-30 18:17:49"} {"_id": "4vc82bvC2MtCybyS8", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n all c:Class,s:Student,t:Teacher,g:Group| c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "opwKS7wyCrS3ACkQr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 13:00:58"} {"_id": "bKZsXYHoEPv7Y2Dgu", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qhKCoobsmm79Dw3sn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 14:43:06"} {"_id": "AGNqcCz4bpHSahDXg", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\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\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "qQKvYeBdP2pXaQscM", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:44:27"} {"_id": "uboqhHCkLpNbKYz9k", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\tall c : Class | some t1, t2 : Teacher | t1 in Teaches.c and t2 in Teaches.c -> 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BzZmWEHHK2iz9PtbX", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 18:06:52"} {"_id": "uiYwbyaDTqu88AHJ9", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher | t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "vSDDsieNYQiaRN6uu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 21:27:11"} {"_id": "CmvzYMYpeeavc3uJz", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher c,d:Class | t->c in Teaches and t->d in Teaches implies c=d\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ns6QcmNspg97jbhAB", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:31:09"} {"_id": "pxqNHHvn8p7rAxde8", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some s : Person, g : Group | c->s->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "E9ftYmE7sxSY3PrZJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:50:37"} {"_id": "5pgcv97ikppT6Xg7w", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6FWcDfHMZqSB4LNqC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 22:32:47"} {"_id": "W9BAaKSxejvz674bD", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vwtyLF3xwqowEN4NG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:21:04"} {"_id": "X8DQCgQusrwSHK5Ka", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8WRqrRMAYkcD2scMZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-3 00:11:50"} {"_id": "ZXphbpSNHe5sa9nke", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n}\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\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "A4F8gtDpQx4W3Hn2r", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:32:54"} {"_id": "Hoerdvm886PQjFo8Z", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xScn4LLek47fXgf8t", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-1 17:54:34"} {"_id": "JbAC5xj7JNY9dWW7i", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some s.(c.Groups) implies some t:Teacher | t->c in Teaches\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "97dXNrJZYvLq5NRmQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-12-2 11:42:12"} {"_id": "7F7YiqH4pBmPmCRAs", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student|some t:Teacher, g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n\npred inv12 {\n\tall t:Teacher , s:Student | some g:Group ,c:Class| t->c in Teaches and c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t:Teacher , s:Student | t in Tutors and !(s in Tutors)\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qmt6j8vfGPsmsBqeL", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:31:11"} {"_id": "N4AiTEwstWhMRLmbK", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Person,c:Class,g:Group | p in Teacher implies c->p->g in Groups \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cqhabJsn2msGTPEgW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:33:35"} {"_id": "NT32Wwjiqjgg7q4nH", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "z8XeeXCd7hkNqqcFL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:27:18"} {"_id": "LrG86s27gqeyfoi5D", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p not in Student and p not in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zKoghZXdiAh9zQwsW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-29 17:03:02"} {"_id": "izgEezbqeBwfviCgg", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.*Tutors and t not in Person.*Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "QEnyA8Ry4eMdpmSSZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:09:41"} {"_id": "sm8YyfxmcvKRDBB8A", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GEghdT8oiHqroG7rC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 18:23:50"} {"_id": "ExdRi7We2SknueM8s", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tno Class.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "xc7roE88QrtpCB7xo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:20:54"} {"_id": "8C5ENzT2F5eN5iyRa", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 all c : Class | all s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all t : Teacher | (t -> c not in Teaches) implies (all p : Person, g : Group | c -> p -> g not in Groups) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher, g : Group | (c -> s -> g in Groups) and t -> c in Teaches implies t -> s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "L3GpsvkYjb4d7mbR6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:17:47"} {"_id": "xLJ8cCALf2vRQu2wY", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1,c2:Class | all t:Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "b9cDmZmbzxFk5Z5QT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 15:03:17"} {"_id": "8NWSjrWA73GbzFEAe", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tWXszrRNxqZ9WTWiJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-4 17:59:17"} {"_id": "qu2ebYg9hMXhAPpDb", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Class | x in Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Person | x in Teacher implies x 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bk7km6ARAb9p6wbzA", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:18:55"} {"_id": "rapTwQewEFkQZ7Sst", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t:Teacher,s:Student | s->t not in Tutors and t->t not in Tutors and s->t not in Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oTujnik4vzBHCpjYu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 18:59:24"} {"_id": "2WG9gmhcrgMQ9nJhD", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student \n}\n\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xmMzQg4YTkDPNQrjb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 23:19:30"} {"_id": "TMhDqwFWMkcSaLpM6", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Person | some c : Class, g : Group | c->p->g in Groups implies some q : Person | q->c in Teaches\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7KzgkuDqY7Q4ZfQ4Z", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:48:23"} {"_id": "gFjS9wkDCBAsA2krw", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | (some c : Class, g : Group | c->s->g in Groups) implies some t : Teacher | t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "keR2DAtSE74BH5GaZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:18:34"} {"_id": "YfMa7RffQ6vhedgnw", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some t : Teacher, c : Class, g : Group | t->c in Teaches implies t->s in Tutors and c->s->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "j7ysYAZ4yNRur7W3P", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:30:49"} {"_id": "TugsWqeFRkPikF686", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\nall t : Teacher | some g : Group, c : Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\nall x,y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\nall s : Student | s in Class implies some t : Teacher | t->s in Tutors and t in Class\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oY8i5XSiToqE5sApN", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:36:13"} {"_id": "DLAofvfh7koWAGcms", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tt : Teacher | some c in Class implies 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eJXp3goRrMH4gEMeE", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:30:13"} {"_id": "a5dB5f26jc3HbyDyu", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class| some t:Teacher | some c.Groups implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "KPCKfa6uKAhEwNTHm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:59:54"} {"_id": "xuM5dks3jYJjrM2LJ", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p: Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n all t : Teacher some c : Class | t->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6TEEmBKSofeQ3xMKN", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:17:45"} {"_id": "FSNvww9BQo6iknqtn", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t all c : Class| some t : Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n }\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some g : Group, p : Person | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KozSnd3BffaNiXWTJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-9 00:32:03"} {"_id": "sNfuSHurFQiERiaWd", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pt9TsQpJcQh4Yzz2e", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 11:30:54"} {"_id": "Q8Wtp43acRpgd9Xws", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\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 | c1,c2:Class | c1 in t.Teaches and c2 in t.Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zLxY2iBoT74WuAY2k", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-12-2 11:29:55"} {"_id": "nFPevhX72jBWnSvDm", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HhEA85bE9hWt6jehE", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-10 17:30:51"} {"_id": "CsX2ppRki99ZCrgRv", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \n \t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tall c:Class, t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "YZ6kBA3ahGHSkom4P", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-2 15:49:53"} {"_id": "uPXcoCcfKkywHGhN6", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "utx9WKywvd79e3WK2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:52:35"} {"_id": "7m2XKRQQfKDs8Bhnr", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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 ~(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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Kk7NCmJGdsZByLcRM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-1 17:59:02"} {"_id": "hqC48fvKYSKZEoYH6", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | (some c : Class, g : Group | c->s->g in Groups) implies some t : Teacher | t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pbD8LcAvFoxZjRfpC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:09:45"} {"_id": "axbEn2XbqPTh2fNQf", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:26:11"} {"_id": "j7ysYAZ4yNRur7W3P", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some t : Teacher, c : Class, g : Group | (t->c in Teaches implies t->s in Tutors) and c->s->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rx2jrnqSrPBPCRQRE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:30:12"} {"_id": "MW5g6KQYhynggxDyA", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "He4Yxz4v6rgdgwMDQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 22:04:05"} {"_id": "Kr4wZeZzLs8bzZC95", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some t : Teacher, c : Class | t->c in Teaches implies t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Pr2K6S5RznXnjQdvq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:25:12"} {"_id": "WA3sNjKhvFLGR5jEz", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.^Tutors and t not in Person.Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "DxyrDzcLK8DmMurmv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:09:05"} {"_id": "amyg6pPDYcgDocX4R", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sBh5TueM78N7putd7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:11:18"} {"_id": "JhfEw4NbGN2Z55EiL", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "saG246LfCyiobfRvt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 11:31:52"} {"_id": "Dy578PHXoADbABCiN", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p,q,r : Person | (p->q in Tutors or q->p in Tutors or q->r in Tutors or r->q in Tutors \n \t\t\t\t\t or r->p in Tutors or p->r in Tutors)\n \t\t\t\t\t\t and (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "j6xFghP4oFcQLZMpK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 20:31:28"} {"_id": "fPw6vGd2rYrwTXGvy", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class , 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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall p:Person | p in Teacher implies some g:Group | p in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t Person.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | s in c.Groups.Group implies some t:Teacher | t->c in Teaches and t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "7R4pXR78SztXTYTmm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-12-1 18:37:00"} {"_id": "3vmXpLbjcDAoDupGP", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall t:Teacher, s:Student | s->t not in Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PXPQjhLz5wNtfejfK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 18:01:09"} {"_id": "78NNqyzMvYX8bd3RH", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall p1, p2:Person | isTutored [p1] implies p1 in Student and isTutor [p2] implies p2 in Teacher\n}\n\npred isTutored (p1:Person){\n\tsome p2:Person | p2->p1 in Tutors\n}\n \npred isTutor (p1:Person){\n\tsome p2:Person | p1->p2 in Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RXL68GL7L9aDXbHzT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 18:10:59"} {"_id": "KqrEhSqGk9h7pB4Jn", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,g:Group | some t:Teacher | c in Class implies c->t->g in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AZ4ZkTJBxNRn8eApn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:49:39"} {"_id": "2vicuYYZfXhn7xyoq", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "mDd5hX92L3PJ2gjaJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-17 09:43:48"} {"_id": "toGsgtvom5JvkdjX9", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Person.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GYtQEHktmFs8FrN92", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 17:21:37"} {"_id": "4Mv3reeCvogRZFthA", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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. */\n\npred inv11 {\n \n all c:Class | some p : Person, g:Group | c->p->g in Groups implies p in Teacher \n \n\t\n \n \n \n \n \n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AfAAoDjRXwXSbKaqh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 14:24:23"} {"_id": "Hu7a9HyiseaSdf6Ex", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \tall p, q : Person, c : Class | (some g : Group | c->p->g in Groups) and q->c in Teaches implies q->p in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tsome p,q,r : Person | (p->q in Tutors or q->p in Tutors) and (q->r in Tutors and r->q in Tutors) and (p->r in Tutors and r-> in Tutors) implies (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "8YeETJZTwds3gwqmg", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 16:05:14"} {"_id": "QbXtSJYM992LmBw3c", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student 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, s:Student|some t:Teacher, g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-3 17:07:32"} {"_id": "swLsQWLKN53Bb6xuJ", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n \tall p : Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | (some c : Class | t->c in Teaches)\n}\n\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | (some t : Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PfqePMTzPLC7aQtKZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:34:53"} {"_id": "45Cs8QoXcwTvmKfre", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nYpFGPJ3ayedQXe2o", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:29:54"} {"_id": "Mc8KtSNRnXKdhW7Bf", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Person.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all c:Class,s:Student,t:Teacher, g:Group| some s.(c.Groups)->g and some t.(c.Groups)->g implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "NGXs87LpqQ4c2SWkj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 21:19:44"} {"_id": "avDh7HoWXgrXGhDcY", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NpceMoDS7PkvAzfdu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-10 17:57:46"} {"_id": "RXfC8jaitnT4wyA3R", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 in Teacher and no Person in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "f6pepXxixQmBsDXkE", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 11:22:22"} {"_id": "wGY5okP5yop8LH8F4", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cBjckEKQGDGMWhnyQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:12:30"} {"_id": "BxBjcQ7FbK8ex6rus", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BkT5h3hSGcm3toupd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:26:19"} {"_id": "jq5P5SB9o5iQ7eY9h", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MWMmHgT7qtbBb8HiR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:34:32"} {"_id": "ZqQ3RaM6KsbG3GJi3", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class,g:Group|some t:Teacher | t->c in Teaches and some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "57fnwSMq3BkH5rAZ2", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:36:31"} {"_id": "unaJpmz82tMoZCC72", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \tsome c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n\t\n}\n\n/* 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tskoDjp5orBoBKsr2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 20:57:14"} {"_id": "v4W2EM5riZce3HT8i", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\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\tsome c : Class | some p : Person | some g : Group | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MJaCtDRsiuDy27HAg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 20:40:04"} {"_id": "4EhcogfSsdmQeyGHj", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n Teaches.Class.Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vuBHYLnnoAbXY3ixS", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:27:43"} {"_id": "66grxBoFzSu5HfJ7h", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FTGTvnEBTwv3Dudf7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:22:17"} {"_id": "R36dwLMqcxaoC9RSa", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies 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\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student | s in c.Groups.Group\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "uZJ2fafHmoFuJbE4f", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 14:44:19"} {"_id": "BWNqpXuqyDCBWnXrM", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, g : Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7SLDdKgHS8qCDHC4C", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 20:51:30"} {"_id": "MWMmHgT7qtbBb8HiR", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "96KjnxFdd5d76H8KE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:33:27"} {"_id": "SyBWQnzqkqMeHjDzP", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n \tall p:Person | p not in Teacher \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MqnoNGumpXiWBCdcA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-28 16:46:03"} {"_id": "75fWABb9gbKBPJ9pH", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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\tall c:Class | some Person.(c.Groups) implies some t:Teacher t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NtbRHguMTtYRS6nmG", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-7 13:21:03"} {"_id": "pzxkik2usBJhqm5Zk", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "QAaFxmifNHY39Q5Rk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-13 16:55:42"} {"_id": "JvKJASkX4qoDHJpMn", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "G9NWLbvkKizSuSZ5s", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 11:30:45"} {"_id": "3QuTMeFTmYGLxiQa5", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group,p:Person |some t:Teacher | c->p->g in Groups implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "88jkngenBbJnQtdda", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 10:49:26"} {"_id": "6ycmekiDJHc6FGdPW", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c : Class | (some p : Person, g : Group | c->t->g in Groups) implies some t :Teacher | c->t in Teaches \n}\n\n \n\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Fd43ZWMH6cSv4TxpP", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-3 00:19:30"} {"_id": "wyKwteKBhNomS6J9q", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher,c:Class,g:Class | (t->c in Teaches) implies (t->g not in Teaches)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,t:Teacher,g:Group,s:Student | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher, c:Class, s:Student | some g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "idS2wduL5v9zPvTZJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:51:42"} {"_id": "de2t78ncwqX4ebctG", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class,g:Group |some t:Teacher | some c.Groups implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bJe6gJAdjBMWWjKgz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 11:00:39"} {"_id": "4aWnXQFheef9atbt5", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n}\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\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Classe | (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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NrAjgAxAdDmxTtwEJ", "msg": "The name \"Classe\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:42:27"} {"_id": "3fdmPpjbRg4Tpm9an", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BLxYx3iATHkcmAF68", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 14:39:15"} {"_id": "xwbDpprhigNHwfELd", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "XG3tfB68ZDBHJoYsr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-21 10:31:32"} {"_id": "gMDWKYACvAhXvvAB9", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n \n all c:Class,s:Student,t:Teacher, g:Group| some s.(c.Groups)->g and some t.(c.Groups)->g implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "n9vfiqi9L8x44mqJK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 15:00:09"} {"_id": "zbHxpc5jjtWGYDqKq", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BNY7e3or6wzdWcuj3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:38:56"} {"_id": "NcjiHSvGJwdSuL2wW", "cmd_i": 1, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\tt1 -> ... -> tn not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Tvv6rpioZG3MYuedj", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-18 16:48:09"} {"_id": "ier9DgaLuqkny8esg", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n iden in (Teacher.Teaches).~(Teacher.Teaches)\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Eu5gf2pCRmEZrSkYW", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 17:25:28"} {"_id": "jmJora7yKbTvfE3fX", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->p->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4YkSm4uiRyJv4BRQ5", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 20:37:33"} {"_id": "THxFEcPdLWZs67KwL", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome p:Teacher,c:Class | p->c in 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\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class,t:Teacher | some g:Group | c->s->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ERwbbZkvfXZe6hRu3", "msg": "The name \"s\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:47:38"} {"_id": "Jrzm4xt9PnFCTjQmN", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:06:11"} {"_id": "fNE4yfpfxQNDQXMyH", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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\tall c:Class | some c.Groups.Group implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "riNaS3YcqyPKmENzi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:53:58"} {"_id": "5Bz33eYmGLnEjJq4u", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p:Person,t:Teacher,s:Student | s->p not in Tutors and p->t not in Tutors \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QckkFkeqomNEDdR4v", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 17:24:46"} {"_id": "FqBJuMygYA3ANSAsW", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p: Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some c:Class| some t:Teacher | t->c\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kRjjzdZ895a5Hzskb", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:28:35"} {"_id": "aHkhZEspqZYSo294W", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wcefQFwxR6sgmuA9F", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-2 15:38:03"} {"_id": "NQL9cnNe9o3DAAgvP", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class , t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c,d:Class | t->c in Teaches and t->d in Teaches implies c=d\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 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\tall c : Class , t: Teacher | t->c in Teaches implies some p:Person,g:Group | c->p->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "RzTYwsPSD7ELk69aW", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:54:25"} {"_id": "i4ZYANN5vwGTAXcfM", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3RBwGrtdDHtRfxsp7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-13 16:07:46"} {"_id": "RM69PkaAFuLqXN8D5", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class | (some p : Student, g : Group | c->p->g in Groups) implies some t : Teacher | t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "egr9xB5dsgxqqqmqq", "msg": "The name \"s\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 21:17:57"} {"_id": "LTQMAZFx7pKe79nE2", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlone Teacher in Teacher.teaches \n \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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kbRtr5daFX3Gug4Xw", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:49:32"} {"_id": "qQKvYeBdP2pXaQscM", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\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\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "T899hDTZrH4mpQWB5", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:43:30"} {"_id": "YZ6kBA3ahGHSkom4P", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \n \t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tall c:Class, t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FdzZERH243rxkXbpf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-2 15:49:38"} {"_id": "4SnRWujdmL3Achaup", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p in Student\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hPstvNST6NsdJL2gr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:28:13"} {"_id": "3xSNtJxcwSWvCYi4Y", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c : Class, t : Teacher, g : Group | c->t in Teaches implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2ynX8maM9FSM9hQv5", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Person}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-3 00:15:05"} {"_id": "kRjjzdZ895a5Hzskb", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p: Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some c:Class; some t:Teacher | t->c\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "afDfErzkwKxJcTfHL", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:28:25"} {"_id": "DmpTtQn5QxkRYgxxY", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no (Student + Teacher)\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uacFyv7sLH3M6ryFA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 17:20:26"} {"_id": "bHMtaLNNABo9KDN6C", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jaqYmfQr3C5A6N5KE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-2 15:39:09"} {"_id": "XnBykCMrhu2fyb5GC", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\t~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \n\t(Teacher <: Teaches).~(Teacher <: 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Frhs8sxb9XHNP2Tzq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-10 18:35:56"} {"_id": "TAgJxsK8nFWi7TSmP", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TBBJdYoaykP6JkP9d", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-10 16:47:59"} {"_id": "9kNGf4e9H2dKoE8cn", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YcSgPQT5GA4muqDg5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 12:13:08"} {"_id": "MpMN46QAi5684JETu", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student or p in Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ybGc8a9M6F6ipuyiu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:34:44"} {"_id": "weQ5BdhaBEM2Q6zxN", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student|some t:Teacher, g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n\npred inv12 {\n\tall t:Teacher , s:Student | some g:Group ,c:Class| t->c in Teaches and c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tsome t:Teacher | all s:Student | t->s in Tutors \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LeWTaD3nsKihEmiht", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:35:20"} {"_id": "qnxNRemor68CuSemJ", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p in Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MpMN46QAi5684JETu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:35:46"} {"_id": "yM5CwetcQt6TEixFo", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class , y : Student | some g : Group | x->y->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DrifMNkLZS64ini29", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:43:00"} {"_id": "TGahc7yGWBm2XRhvZ", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n \n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3y4Wc7F4WscBYaGNz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 10:45:44"} {"_id": "b3u28RvNbHyjtxKj8", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hAaAoZhXfzGBp3qgd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-2 23:42:41"} {"_id": "RGS5uGbDXoWxy7La9", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eXG2wa7YzY3acpjDr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 10:29:30"} {"_id": "nW4iwCFfv6jb78hTW", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class,g:Group |some t:Teacher | some c.Groups implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DX4Ny3nxJXmZtdCve", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 11:00:44"} {"_id": "XGSvRZLhGKGBEFYGM", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "E5N4oCFjPZSuwmj4A", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 20:59:29"} {"_id": "ZdSi9gBiqPM9gCGKJ", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aofTxDG9vk9YkatuT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 10:56:17"} {"_id": "7HAjx6Xyiq2XcbgJS", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher <: Person.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "toGsgtvom5JvkdjX9", "msg": "<: is irrelevant because the result is always empty.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 17:22:04"} {"_id": "WAJvSL3XT2KFYNzGg", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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/* 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DBBnu8C8khZo3cosh", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 10:55:32"} {"_id": "r7GK3jZwmLTXEGN5o", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome p:Teacher,c:Class | p->c in 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\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hnDBXYrRPbav5szDm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:51:40"} {"_id": "ofv4vDiousArs6q7t", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t all c : Class| some t : Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | some c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "93LKhboWFDvvz6d6Y", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-9 00:09:44"} {"_id": "e5WxmNSRC5RhtErGY", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some q : Person, t : Teacher | t->p in Tutors or (q->p in Tutors and t->q in Tutors) or (t->q in Tutors and q->p in Tutors and p->t in Tutors)\n}", "derivationOf": "keJDTsEf6Ypoq6TcY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-3 07:08:53"} {"_id": "xa5FPaEoESQwqPEWN", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher, y : Class | some z : Group | y->x->z in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n some x, y, z : Person | x->y in Tutors and y->z in Tutors implies z in Teachers\n\n}", "derivationOf": "BRkGsDrWL9LKN4yJW", "msg": "The name \"Teachers\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 13:08:00"} {"_id": "3RmHaZBpvBte2Lmwz", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n \tall p : Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | (some c : Class | t->c in Teaches)\n}\n\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | (some t : Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c : Class | has_groups[c] implies (some t : Teacher | t->c in Teaches)\n}\n\npred has_groups[c : Class] {\n \tsome s : Student, g : Group | c->s->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GQBFHoso2w8oiDoLK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:43:44"} {"_id": "2ATuEkpH99oM4jFAJ", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c \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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oR6LSvELED6NhzFSH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 18:57:17"} {"_id": "Y8yR4sm2JNRAhoBRh", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class , 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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "w326BMSimEq5JydD2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-1 18:23:59"} {"_id": "z8XeeXCd7hkNqqcFL", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qiJgbzwLJqg95xjxC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:27:07"} {"_id": "pNbXwZp3CERFjWj6j", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class|some t:Teacher | t->c in Teaches and c.Groups.s and c.Groups.t implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "zWdWPKEQpjbjLYnDS", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 11:33:10"} {"_id": "4Z5MFS8QZghj4sAao", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome p:Teacher,c:Class | p->c in 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\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jDevARXS5khCCJn6D", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:40:29"} {"_id": "HhPjqbuN97uz6hPoc", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MBrL7qx6a5EasoTKP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 20:26:21"} {"_id": "DpY3ivrAr6rdDHoCx", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WF2ivKgS6akee5Lz4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-2 23:49:12"} {"_id": "F64dD5kSeQRe5fPuA", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BxNJpotECXdLPhmJf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-2 15:27:43"} {"_id": "9GSkErexG34ZsWfX5", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "j9pT97guGHNsFp53P", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 09:14:17"} {"_id": "BCi7WczRtnQd4jNA3", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dyZw5n83kPFhxwLLC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 12:13:20"} {"_id": "n7iswmAMqgBQHF8X6", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \t\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\t\n \t or p in Teacher\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "w7DBuFKibXc9X4CR5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 18:11:34"} {"_id": "c5Pk3H9zqrzjF6NM9", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher, c : Class | t->c in Teaches implies some p : Person, g : Group | c->p->g in Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "q3Dt94NkESwy7GCjX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:18:07"} {"_id": "ZN8h3B6eMttYmwb3s", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 \t\n \tall t:Teacher | (lone t.Teaches) and (lone t.Groups)\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CALFGA7qfgcKRFw2Q", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:29:28"} {"_id": "GCeDxwdYf3vBzqM46", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some t : Teacher | t->p in Tutors or (some q : Person | q->p in Tutors and t->q in tutors)\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "msg": "The name \"tutors\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 05:51:31"} {"_id": "cdL7vgWnzxCYXdNJP", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class, g: Group, s: Student, t: Teacher | c->s->g in Groups implies (t->c in Teaches\nand t != s)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "D2PtKsu9npqYgjFPX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-30 22:25:06"} {"_id": "nM9QXhvQMrZKo8e96", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \t\n\n\tall 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YyBCY4dEc4NRs6L85", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 15:57:40"} {"_id": "xigi4n67R32Ebf6Si", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teache \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JrpkK9fJQgry8sxuf", "msg": "The name \"Teache\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:45:46"} {"_id": "xkwpy4CcN29foF4f4", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Person & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xwZCeAvyb6hMeaM3p", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-1 17:28:17"} {"_id": "AHKky9W3rdSNsPCtJ", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \tall p, q : Person, c : Class | (some g : Group | c->p->g in Groups) and q->c in Teaches implies q->p in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tsome p,q,r : Person | ((p->q in Tutors or q->p in Tutors) and (q->r in Tutors or r->q in Tutors) and (p->r in Tutors or r->p in Tutors)) implies (p in Teacher or q in Teacher or r in Teacher) \n}", "derivationOf": "dBW7qQJhpCsBx3ZHt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 16:14:43"} {"_id": "4oKKjYkFavaaDYyTQ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class| some t:Teacher | some Groups implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "zzpC7JS38Gg26ntCd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:03:19"} {"_id": "BzZmWEHHK2iz9PtbX", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\tall c : Class | t1, t2 : Teacher | t1 in Teaches.c and t2 in Teaches.c -> 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Cvjt9j36SEprtqdiH", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 18:06:33"} {"_id": "3RBwGrtdDHtRfxsp7", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-13 16:07:39"} {"_id": "ycAWBqdNovk9gp6Xi", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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. */\n\npred inv11 {\n \n all g:Group, c:Class | some p:Person | c->p->g in Groups implies p in Teacher\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "C8eJfRyewP9Ke8WbQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 14:30:35"} {"_id": "JSBjAprJQevFfiCzz", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | c in t.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\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 | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some g:Group, t:Teacher,p:Person | c->p->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gPTiuk89T9fZmXNyb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-21 18:07:02"} {"_id": "jgYSbne6cYdwPgiiw", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | ((some g : Group | c->s->g in Groups) and t->c in Teaches) implies t->s in Tutors \n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Jcja4GuGXqjqrnWF5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:09:36"} {"_id": "rkRh6GuJYaT8Z7J4D", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Sc9CeTBtw5QSqhWqj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-12-2 12:14:30"} {"_id": "vWhtqeN254SsD8wgS", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "G8exR2S7mD8X8qsuo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:24:20"} {"_id": "RKaSaPKNtBE8daHkp", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SPgvA25SrQ7CBiY4t", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 12:54:10"} {"_id": "FAATdNueew6Kb3zbL", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "u6qTgNSz6r73kvngq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 11:56:03"} {"_id": "nRJgjz8b865JM9puk", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iWrmQaQT2rEQNcBkm", "original": "YH3ANm7Y5Qe5dSYem", "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": "Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "Student:Person"}, {"parent": "Person", "type": "Teacher:Person"}]}, "nodePositions": {"Class": {"x": 475.9937438964844, "y": 265.3333333333333}, "Group": {"x": 634.6583251953125, "y": 132.66666666666666}, "Person": {"x": 317.32916259765625, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}]}}, "time": "2019-9-26 10:53:57"} {"_id": "DhoqKpdLjassC7Lrg", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | one Teacher in Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pT4nCWtWeQtWnretE", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:43:32"} {"_id": "G3jepF6mgeku6ihDt", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Qg8Rz5dweXnPqySqM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:37:51"} {"_id": "wT5HqHJXmutAzAeNo", "cmd_i": 4, "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall p:Person | \n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kYmZRuomj3MnzjbCr", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 10:42:52"} {"_id": "KXRYDybg7JoZDxejX", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | (c : Class, g : Group | c->s->g in Groups) implies some t : Teacher | t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "W6zWGcGpwphWKFmbd", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 21:08:41"} {"_id": "jZ3HeZPDmAAzBwwsg", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n Teacher in Teacher.Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4EhcogfSsdmQeyGHj", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:28:10"} {"_id": "Q3dJo5EZkZE537c6v", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\t\n \tall c:Class,g:Group |some p:Person,t:Teacher | p->g in c.Groups implies t in c.~Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "upxrAqf9QZYxNsiGC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 17:16:35"} {"_id": "hAaAoZhXfzGBp3qgd", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2Lc6pvZkPTPhcpYLG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-2 23:42:23"} {"_id": "9NhkD8fnYGfK4BoY5", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\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 & 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nMdZ9xBgzxMJFDJzZ", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 11:47:06"} {"_id": "8Dx6SayGa4fNKZL3G", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hwoesC7RcuwriWMui", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:40:50"} {"_id": "zWXq9Xki4G29NQiPs", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "3WCFjfy3fCt7G69XB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 14:47:44"} {"_id": "v7LNcKkuFApr2dJac", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9nQZ2HG42kFrTCvXh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 22:04:00"} {"_id": "bfjN4PmRXP9YK8sat", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-30 18:17:39"} {"_id": "7GW3T8ibyCKHZQRj2", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | c in t.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\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 | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nwr7HF6C2EPWoAiDF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-21 16:52:45"} {"_id": "LwYcmrQbRRy6vgptq", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mSricdB8DuvEZ7B5v", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:24:46"} {"_id": "ejnSWkJKzew6x5W69", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,t:Teacher,g:Group | lone c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "rjT8DucpTFeYSizGb", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:23:47"} {"_id": "MigBfJypprkgM2LvJ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class, s: Student, g: Group | some t: Teacher | (c->t not in Teaches) implies c->s->g not in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NASeP4fCrs99Xwx3S", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Person}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-30 22:17:35"} {"_id": "mSL6wGvZyeEaCFf3p", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zoaqSgaLm9jZ88WYj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 12:02:30"} {"_id": "thQexJYx3EZ6be3Rm", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student \n}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gadxAfMZciW9rF2Lz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-1 17:46:47"} {"_id": "tYdsFNf9R8unocBEJ", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher,c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | ((t1->c 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uzqyhBmoohuhJfJfT", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:41:43"} {"_id": "ffvDSJuekipBouyPf", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,g:Group | some t:Teacher | c->t->g in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kKc5cEF4LeEhsQPjr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 18:52:13"} {"_id": "kMfG6grjFax3T4X9h", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches \n}\n\n\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4qzCDuYKBA7StwExY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-3 00:22:16"} {"_id": "9BxbrMyvNoqufYEGF", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1,c2:Class,t:Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c:Class|some t:Teacher, g:Group | t->c in Tutor implies c->t->g in Groups\n \t\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9WB7Micp2Dj4ffaXM", "msg": "The name \"Tutor\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:25:29"} {"_id": "GpSRXWHT9uofoGjdS", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "99NtbFuxxmyPaXvPb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 14:39:25"} {"_id": "s75iEzifWZDhnWHzZ", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome c:Class | hasTeacher[c] \n}\npred hasTeacher[c:Classes] {\n\tall g:Group | group_has_teacher[g]\n}\npred group_has_teacher[g:Group] {\n\tsome p:Person | p in Teacher and p in g\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mDbzuyGef6EBiFQi4", "msg": "The name \"Classes\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:33:59"} {"_id": "6x57PegH2vSTCDBiH", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student, g:Group|some t:Teacher | t->c in Teaches implies c->s->g in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hQv3JYNSZyqyhfodG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:25:54"} {"_id": "BZbfFrMvTFDTtMkxk", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class,t:Teacher | s in c.Groups.Group and t->c in Teaches\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "3yh3zjGnYHFWAW8uf", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-12-2 11:44:56"} {"_id": "NPXL3NaZBmm4YYnus", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PaYBkkDoaMQ4ggm8n", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:40:25"} {"_id": "6mryGvbNoNMRNDPi4", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n \tall p:Person | p not in Teacher \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t1,t2:Teacher | some c1,c2:Class | t1->c in Teaches and t2->c1 in Teaches implies t1=t2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bLPD2aWN4A3H8qbvs", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-28 17:01:32"} {"_id": "BZwBsHmq2EqWqk5wp", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "acfE3KorMuX2seHdx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 20:28:15"} {"_id": "36N9qp6RgwMk5JjrN", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nset Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7sLe6xQ3veHqrfffA", "msg": "There are 5 possible tokens that can appear here:\nenum fun let open pred", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 21:52:50"} {"_id": "dy7gSh3MGZCQSEYx9", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,g:Group | some t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "B4gPZbQWmeGTJABPY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 20:44:23"} {"_id": "8G9Rvis74hQdJsy8P", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n \tall p : Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | (some c : Class | t->c in Teaches)\n}\n\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | (some t : Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "swLsQWLKN53Bb6xuJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:36:20"} {"_id": "YXi6wZP5TxwkC7a2t", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "kY7t82QcaN7LZ7YSf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 15:49:19"} {"_id": "SHHuCYRkX6L49qW37", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1,c2:Class,t:Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c:Class|some t:Teacher, g:Group | t->c in Teaches implies c->t->g in Groups\n \t\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some c:Class, g:Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cGfJQv7WSmY3MqHPJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:27:17"} {"_id": "mfqz85S6qzcQzfuG8", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t:Teacher | lone t.Teaches\n ~(Teaches<:Teaches).(Teaches<:Teaches) in iden\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zv29u76eui9bpc745", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:45:04"} {"_id": "ZYkDRHBXZMf2XTkW3", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tno Group.~Class.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "uPJoj2oQs8vfjoG5Y", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 10:22:17"} {"_id": "rH22m8uER83XjGk2w", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6skxd86JJc3QBh6mq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-1 17:53:20"} {"_id": "W7gyieMfKwgDZeXWt", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Person,c:Class | p->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZdaX49jLfcAqAeTBf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-28 21:44:43"} {"_id": "mLpz9RXQ7z5eW8s9r", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Person,c:Class | studentInClass[s,c] implies some p : Teacher | p->s in Tutors and p->c in Teaches\n}\n\npred studentInClass[s:Student,c:Class] {\n\tsome g:Group | c->s->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZNPHyDTAwMRjjSK2M", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:01:14"} {"_id": "uouwHfEKM3rjbnTr7", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class,g:Group |some t:Teacher | some c.Groups implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "ssCTn3GeE3NrQgzpE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:01:20"} {"_id": "n9vfiqi9L8x44mqJK", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student,t:Teacher, g:Group| some s.(c.Groups)->g and some t.(c.Groups)->g and t->c in Teaches implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "QPPMGT5iDXEqCnc5D", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 14:58:36"} {"_id": "cqKm24HB9cvWsu9Hv", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some c : Class, g : Group | c->s->g in Groups implies some t : Teacher | t->s in Tutors and t->c in Teaches\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qNMR4fbbTZhRDdYTK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:20:53"} {"_id": "qkb4Z4E46RDj6mBKL", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XKmgPZJqu6ZzvAFLC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:30:51"} {"_id": "AetQ2br2fNxxY7r7T", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "n4S2Hh5xPpacbHMC6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-30 22:16:07"} {"_id": "kPChmnjQPXSjRog7A", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, x, y : Teacher | y->c in Teaches and x->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in Groups\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eJPK5WtxtQqhfGB2b", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 17:40:01"} {"_id": "gy4v8D52Yn8bHgY59", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher,c:Class,g:Class | (t->c in Teaches) implies (t->g not 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CCGSkFGHFgtXjChFr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:29:10"} {"_id": "bEhEGnWjriGmnMZtq", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\t\n all 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\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "m6gr5Jxn2E5DbZBZq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-21 10:57:57"} {"_id": "dBB3fnAGvi5xgAYxG", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall t:Teacher,c:Class | some g:Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pR3P3TmAsKFdgQt5o", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:46:41"} {"_id": "9zFH5m9vypqtQrC3E", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "byby3N48QZBFx2eyh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-1 09:59:33"} {"_id": "QEnyA8Ry4eMdpmSSZ", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.^Tutors and t not in Person.^Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "WA3sNjKhvFLGR5jEz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:09:30"} {"_id": "zkcCew4NAjtL9yWuP", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class 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 | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6z8C8zebLfKGaiifP", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:17:22"} {"_id": "MaZLtxYs66LN6r2et", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mtyhENLnwRt4fYQux", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:47:05"} {"_id": "2QrTAd3v2K8YtTSc7", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-21 16:41:11"} {"_id": "RbcFNYtGPRncPfkNZ", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ApwdL2Bq6duv5Smo2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 17:36:53"} {"_id": "h544eY2sf8cRumx5G", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JvHjDHuFpQJ9uJWCZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 10:46:19"} {"_id": "ahK3eB8tTv9tpQCjo", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\nall t : Teacher | some g : Group, c : Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\nall x,y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\nall s : Student | some t : Teacher | t->s in Tutors implies s in Class\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "x5iaCKTbkaokPeKPL", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:33:29"} {"_id": "tHMfXqpYePtZF35X7", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall t : Teacher | t not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hSiXAktZoC3FP2NYE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-18 16:52:52"} {"_id": "77CMZw3zPPQMJbjH3", "cmd_i": 12, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \tno Student in Person.Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "eLeQYw8nRwYTkqbQP", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 09:54:36"} {"_id": "ccXcpQnmKJ79fWgYc", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Jrzm4xt9PnFCTjQmN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:06:44"} {"_id": "KtFNRaz9gG4b9XtTT", "cmd_i": 4, "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall p:Person | p in Person\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wT5HqHJXmutAzAeNo", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 10:43:10"} {"_id": "enztAB4qWmTnemMGT", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors \n}", "derivationOf": "Q9TvbdkdzYmm4hmhC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 09:50:35"} {"_id": "Ek4SeDRiqgBHcpNgT", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n \t\n \tall c:Class | some t:Teacher,g:Group | some c.Groups implies t in c->g in ~Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "xuurti45NGztWSmdr", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Class->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 11:08:51"} {"_id": "ukzhyTu4Ypmwo6Jdn", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aSopLHwxnKt6mP93N", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 18:00:32"} {"_id": "gBJL9H4M7vzojrMz4", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some c.Groups\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ier9DgaLuqkny8esg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 17:27:20"} {"_id": "56YzPxxRGD6HX3rot", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some g:Group,t:Teacher | c->t->g in Class implies t->c in Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2hpTS6XRXKpn4gehb", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 18:46:59"} {"_id": "GnnFBfEs8fkR8vPFw", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\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\t\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "F4db4b3CiQQkS8Qgo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 10:46:05"} {"_id": "qjKYPaQcvSeoMe2KH", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some t : Teacher | some s : Student | some g : Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "a6YML64pAfYANDtsB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:26:58"} {"_id": "wLeLQ2YcwStoN6icv", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hQnDA6JhEr9CjL4f6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-1 09:47:55"} {"_id": "i3toD76dnHGYPBDdw", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n \tall p:Person | p not in Teacher \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pTpsYoyoaGYa2E2xL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-28 16:55:05"} {"_id": "7f8eXF5QvepzT74oW", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | c in t.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\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 | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | Class->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "f8cZNMjCiDKwwNLXt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-21 18:03:56"} {"_id": "S2hGoPuKWyAvNb2cH", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 Pereson\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "msg": "The name \"Pereson\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 16:39:30"} {"_id": "jDAPNtJ5v5n4BmpvJ", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher, some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dzanmfipg4rtaJogH", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:11:31"} {"_id": "uacFyv7sLH3M6ryFA", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5h7bN85vRNCv8d5E6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 17:20:12"} {"_id": "RawvgojufaN5tvnXt", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7HAjx6Xyiq2XcbgJS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 17:22:12"} {"_id": "quL89W52WhpMgj8bm", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class, g:Group | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hJFobmjKtcPdF5guY", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-30 18:42:04"} {"_id": "nvamxsEas8vzvF7K5", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tTeacher in Group.~(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "HZX5jT6pX57CsKNZh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:24:50"} {"_id": "tMaJQBBApd28TJ5Yy", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vEdr9CxjvRLHu4Zom", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-3 10:11:49"} {"_id": "Cjps7ofLo3RfiBD9o", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n \n all c:Class,s:Student,t:Teacher, g:Group| some s.(c.Groups)->g and some t.(c.Groups)->g implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "gcxfbdzyWFFGTWXfN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 21:18:12"} {"_id": "PJh4ZDkXKcaGPhqe5", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Q3QMMxatSmjGwTeRn", "msg": "The name \"Teachers\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:09:56"} {"_id": "eJnDwz8BNiY6QhDBs", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n \t\n \tall c:Class | some t:Teacher | some c.Groups implies 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\tno Student & Student.Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "8rkyFTdoedezKcuxN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:22:27"} {"_id": "ZdaX49jLfcAqAeTBf", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Person,c:Class | p in Teacher implies p->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QdbPNt4649fbZFtdi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-28 21:44:26"} {"_id": "avHvxCYqe4fs8RhXn", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tnone p:Person | p not in Student or p not in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "W5uWYe33b9hPXYn42", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:37:34"} {"_id": "gtqszdpgJuo6DCF3a", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class| some t:Teacher | some c.Groups implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "4oKKjYkFavaaDYyTQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:03:42"} {"_id": "Pe7ZkS7EQWtfFhmDx", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n \tall p:Person | p not in Teacher \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t1,t2:Teacher | some c1,c2:Class | t1->c1 in Teaches and t1->c2 in Teaches implies c1=c2 | t1->c1 in Teaches and t2->c1 in Teaches implies t1=t2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6mryGvbNoNMRNDPi4", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-28 17:01:50"} {"_id": "J2ZhjCa4qFkdbj24G", "cmd_i": 6, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some c.~Teaches 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AAzb9onPg32ZxiJp8", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-30 18:30:21"} {"_id": "byEHtZmomM73PSHYG", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tsome t : Teacher | all c : Class | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "equXvcF27vEJzuc4k", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-9 00:03:40"} {"_id": "753pfAhoe6zjJo3B3", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \tall s:Student,t:Teacher | s not in Person.^~Tutors and t not in Person.^Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "EYWLis3qEhZFExHta", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:56:29"} {"_id": "Qioc93EkwofwoDTGK", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 all c : Class | all s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all t : Person | (t -> c not in Teaches) implies (all p : Person, g : Group | c -> p -> g not in Groups) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Person, c : Class, t : Person, g : Group | (c -> s -> g in Groups) and t -> c in Teaches implies t -> s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n some p1, p2, p3 : Person | p1 -> p2 in Tutors and p2 -> p3 in Tutors and p1 in Teacher\n}", "derivationOf": "uqJGrhLBr5GP57WtR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:22:09"} {"_id": "Jcja4GuGXqjqrnWF5", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Person, c : Class, t : Teacher | ((some g : Group | c->s->g in Groups) and t->c in Teaches) implies t->s in Tutors \n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5f4cSxTyLqkewNq2B", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:09:30"} {"_id": "SGJ7kN5aPnGNt6EHq", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | no Teacher in Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zuA22HTRWxq6RPHim", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:44:21"} {"_id": "m6gr5Jxn2E5DbZBZq", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\t\n all c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "fLjQ9T22Qo8EMxctx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-21 10:57:24"} {"_id": "NhYi9RaHT3GMHBnXr", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\t\n\n\n\t\n \n \n \n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "QHQ78Bvj9ELv4mBv6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:25:46"} {"_id": "6KAQbJY5oXaaWjNqW", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, g : Group, t0 : Teacher | c->t->g in Groups and t0->c\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PyXaTvuQ6SN6TM9ut", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 11:36:51"} {"_id": "SGYDfr6Lp2J3D9cb9", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class , t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c,d:Class | t->c in Teaches and t->d in Teaches implies c=d\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 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\tall c : Class, t: Teacher | t->c in Teaches implies some s:Student,g:Group | c->s->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ousdZ59mMrcEWtz5b", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:42:33"} {"_id": "a2Z9n6QJPfnCGXPZW", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall g:Group | some t:Teacher | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "xZ7ritqyKqCy4Du6j", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 15:29:05"} {"_id": "ENAmZku3YFynpEWkh", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Person | some c : Class, g : Group | c->p->g in Groups implies some t : Teacher | t->c in Teaches and t->p in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "E99PX3GbhCGSrFppj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 15:40:20"} {"_id": "Fu73f6JPogNpsvvi3", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class , 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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall p:Person | p in Teacher implies some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t Person.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "c4Er9mgXDfjFsYfMK", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-12-1 18:31:28"} {"_id": "2e6x6PpkuFgCWvBFi", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 17:25:52"} {"_id": "v25hW3uM4eMw45rxd", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class,g:Group|some t:Teacher | some c.Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "xhAZJiJt7YiA37zCW", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:34:53"} {"_id": "eNYDcZHhE6Gktzv2R", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\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\tall c:Class,g:Group,t:Teacher | c->g->t in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "Qb8vLepZcZQs3RtHc", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Group->this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-10 14:59:20"} {"_id": "oPRprchuW2YipABN2", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 all c : Class | all s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all t : Teacher | (t -> c not in Teaches) implies (all p : Person, g : Group | c -> p -> g not in Groups) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uML8KG4vWsgDfs4Yu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:11:57"} {"_id": "6skxd86JJc3QBh6mq", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4puWnHkvEPsS83DzN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-1 17:52:30"} {"_id": "kY7t82QcaN7LZ7YSf", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "YpzFk6faEtAZsNrhG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 15:49:16"} {"_id": "vYdTA43wSyhgKDyyd", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tLHbkiaLxttJsQTi8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 12:53:49"} {"_id": "tQATbnA9EHwRSvtbz", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6csWPtxj9NBu29J2G", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 10:33:40"} {"_id": "EKseKKuEeHZvtt6T7", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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.Groups in Teacher.Teaches \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eFx77iewG7HWYoris", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 17:49:20"} {"_id": "CCGSkFGHFgtXjChFr", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There 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\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher,c:Class,g:Class | (t->c in Teaches) implies (t->g not 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Xnn39m6QQopZoSrbT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:28:45"} {"_id": "W6WHF3Zn3uM7F2eu7", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups implies (some t : Teacher | t->c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Qw9MY2Zo5aFYBGKyr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:33:18"} {"_id": "37g9XZjXKPqrBYTAT", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n all x : Teacher | some y : Class | x->Y 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MGzd24BRN595oD7hk", "msg": "The name \"Y\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 12:01:05"} {"_id": "uzqyhBmoohuhJfJfT", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher,c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nm6FP4mqXKLiJQZpr", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:40:59"} {"_id": "mL5cgnM3ffgzLHjr4", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \tno Student.Tutors and no Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "753pfAhoe6zjJo3B3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:00:44"} {"_id": "ybGc8a9M6F6ipuyiu", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student or p in Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7hmqLiPKTPpHSEHBA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:34:40"} {"_id": "5gEJ7A53bBFuD6fDH", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eNtLffa39nKgwZLff", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 10:32:24"} {"_id": "HKaNFdwRxeHz8k7jm", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,t:Teacher,g:Group | one t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "3JS4dYHWcP9Kuh2eE", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 11:22:25"} {"_id": "Fzji8TtquwfQBeZq5", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, p : Person, g : Group | c->p->g in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\tall s, t : Person, c : Class | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p,q,r : Person | (p->q in Tutors or q->p in Tutors or q->r in Tutors or r->q in Tutors \n \t\t\t\t\t or r->p in Tutors or p->r in Tutors)\n \t\t\t\t\t\t and (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "KRGePDNfm7EXgbyoi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 20:42:18"} {"_id": "xYe4q97iNNPAPgwyB", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p: Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n all t : Teacher, some c : Class | t->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xuM5dks3jYJjrM2LJ", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:18:08"} {"_id": "Jf2wo86HLQRkbcnWR", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n \n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6a7m4JvXxWKeq7FDx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 10:45:37"} {"_id": "xX3WohjMRqZFhSfuS", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies 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\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "R36dwLMqcxaoC9RSa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 14:45:21"} {"_id": "QckkFkeqomNEDdR4v", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t:Teacher,s:Student | s->t not in Tutors \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wQpxs6xYZqXxj22fq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 17:22:58"} {"_id": "4fuoDgyZBCzuDqJMa", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student | all g:Group |some t:Teacher| c->s->g in Groups implies t->c in Teaches\n \n \n \n \n \n all c:Class,g:Group,s:Student | some t:Teacher | ( c->s->g in Groups) implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5xxJrEKnCDswHR2qx", "original": "YH3ANm7Y5Qe5dSYem", "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": "Int"}], "metaSubsetSigs": []}, "nodePositions": {"Class0": {"x": 222, "y": 199}, "Class1": {"x": 444, "y": 199}, "Class2": {"x": 666, "y": 199}, "Group0": {"x": 222, "y": 298.5}, "Group1": {"x": 444, "y": 298.5}, "Group2": {"x": 666, "y": 298.5}, "Person": {"x": 444, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}]}}, "time": "2019-10-2 11:45:34"} {"_id": "WZxzimvrNvkXZakHz", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \tall p, q : Person, c : Class | (some g : Group | c->p->g in Groups) and q->c in Teaches implies q->p in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p,q,r : Person | p->q in Tutor and q->r in Tutors implies (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "2ACBt6wKCXpZaDLCK", "msg": "The name \"Tutor\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 16:03:31"} {"_id": "iWrmQaQT2rEQNcBkm", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xigi4n67R32Ebf6Si", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:46:14"} {"_id": "AF7Qns5ngvibcxBWm", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BsmrvoKK5zctHFxab", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 09:49:44"} {"_id": "svn8qdQwJg2r3RaJt", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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\tall c:Class | some Person.(c.Groups) implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "75fWABb9gbKBPJ9pH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 13:21:18"} {"_id": "qkWtu5Tj9jo7PkgWR", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class | some Person.(c.Groups) implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "fiW2c7HqhALgogZwN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 12:18:53"} {"_id": "LYSkhefs4NH7y2jih", "cmd_i": 1, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p in not 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2sEbJ2RvFWHzL9X4A", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:21:38"} {"_id": "SkQasDZe7SNQYnaYg", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pxqNHHvn8p7rAxde8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:51:23"} {"_id": "GibDvYtc48nFKZu6M", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class ,g:Group | (all p:Person | p is Student and (p->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "T7GTEgnYErdSEr8D8", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:47:46"} {"_id": "7YxQMrcEn5bGSZhCt", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "grJW9KWpwMba27LxY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 13:07:16"} {"_id": "TAyRrSo5G79BKirhQ", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8pv9YrfaL84kNemz9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 11:29:20"} {"_id": "g3opyETPoAE6LqyLr", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student,t:Teacher |some g:Group| some s.(c.Groups)->g and some t.(c.Groups) and t->c in Teaches implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "fmfPmZpKnNSGcNDax", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 14:58:07"} {"_id": "qxNKjBnbjWNbEuEug", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher, c : Class | t->c in Teaches\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "R6i9w9JkTAkQvdE5e", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:25:27"} {"_id": "FaXJS56NrSap8dbzp", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, g : Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tZEG4743xJKgXja6N", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:32:35"} {"_id": "XDdLKo4Hy5F2GSqYy", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "57ZKEEazrkqAn7A9R", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:34:16"} {"_id": "DxyrDzcLK8DmMurmv", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student | s not in Person.^Tutors \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "cEk9RrWe9pQkEAYtR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:08:31"} {"_id": "uXekGetG6pEgBpiB6", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher, y : Class | some z : Group | y->x->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Tt8KMXkmWafyLmGqP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 13:23:03"} {"_id": "6XdJ7xy23z7R55itS", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\t\n\n\n\tall c:Class | some c.Groups \n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "PqLeegvPmJ3njf3WB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:16:59"} {"_id": "Cetqy6cn7hxhAQPMg", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n \t\n \tall c:Class | some t:Teacher | some c.Groups implies 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\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "eJnDwz8BNiY6QhDBs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:22:49"} {"_id": "W78XrqNAdwrPEAQEh", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zLQ2xKKgvNdd4D2nM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-9 00:00:58"} {"_id": "G4mER8JZ5aEYv8f5x", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:23:36"} {"_id": "LjZHXZWjr4yJ3ZPgH", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class | some Person.(c.Groups) implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zhvi4bc5XMmeWSFdD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 12:17:13"} {"_id": "X9aWuid2ySgZyWJ2s", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "L7dpEP4z6Hv4BwgiN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 14:45:22"} {"_id": "HZeHvMfXgd4ES652B", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, g : Group | t->c in Teaches and c->t->g in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6theGPJk4Y5udJ2He", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 20:57:36"} {"_id": "Y6w2KboAHyf5TDTN9", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n \tsome (Teacher in Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tsome (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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Sxn2hFMqXKc7N3FQR", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 21:37:13"} {"_id": "MNikLWxx9ZvNeZKLC", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \t\n \n \tGroup in Class.Groups->Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "E2ucjXk8v4j9sm6PS", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Group}\nRight type = {this/Person->this/Group->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 10:27:05"} {"_id": "SQYpjpAtakKoyoFSp", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SGCcXR2bGpKE9H2Kf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:18:59"} {"_id": "rmBRg9r6CRQ5AJivx", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome p:Teacher,c:Class | p->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vdeiw3d4WTFJLgrs6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-1 17:49:35"} {"_id": "Gun9gr4gDnz6noeXG", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jaZuK4cqhw7GRpfBW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:33:45"} {"_id": "Z4T5Qpf2iYu5QtnXz", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall g:Group,c:Class | some p:Person | c->p->g in Groups implies p in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "xzi4tB2NMQygBdCeZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 20:58:54"} {"_id": "KaQZkckt88GoRWv3o", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\n \tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher,c1,c2:Class | c1 in t.Teaches and c2 in t.Teaches implies c1=c2\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NgR99i6YNYWt5HAiY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:31:27"} {"_id": "SWDHRStbZDzNztdCH", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t~Teaches.Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xgucg94huXK7MNXTq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-4 18:07:58"} {"_id": "G9NWLbvkKizSuSZ5s", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iSSmHbJ9Sc5qPmRvn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 11:30:43"} {"_id": "ZeQBXhpqWZCCtEjEP", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 13:17:23"} {"_id": "j9pT97guGHNsFp53P", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "e6xbgdErqrJQcFfoy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 09:13:54"} {"_id": "8DkFZp6PbRHm2Zfti", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Teacher | some c:Class | p->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7Pb965F2NbrCHrmzJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-28 21:49:32"} {"_id": "APkz6S2up3BNDjtkB", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student,t:Teacher | some s.(c.Groups) and some t->c in Teaches implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "nvCq3bZhnMgnYgLZW", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 14:54:43"} {"_id": "Dh88mLSZi3SNpb6jX", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fJAZXTSdQzKDmetrh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:28:43"} {"_id": "T7GTEgnYErdSEr8D8", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tsome t:Teacher | (some c:Class | t->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MsfZ2Hk9Ncsh3e4Ps", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:43:51"} {"_id": "JvwWzwKk43s3R3CE7", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class | some Person.(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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "xs5RmWFmf8wCqMkF2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 13:14:01"} {"_id": "NgM4ePm89ixzRwdqM", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 implies p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ygkEWbZEe4XAfbMDM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:20:05"} {"_id": "Hk5LZQeyhixosXG8C", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student | s in c.Groups.Group\n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "uPXcoCcfKkywHGhN6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:53:53"} {"_id": "KeJoApuTJm6tMbskZ", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone c.~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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TkgRuCrANF2P7btLv", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 18:03:17"} {"_id": "LYd35G9nXzE25vLYo", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n some t1:Teacher , t2:Teacher , c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall t:Teacher | (some g:Group , c:Class | (t->c in Teaches) and (c->g in Groups))\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qd6piJPd5vAcrra87", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 14:58:26"} {"_id": "c5NJt2KNJ26vqg37u", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n \tall p : Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n\npred inv5 {\n\tall t : Teacher | (some c : Class | teaches_class[t,c])\n}\n\npred teaches_class[t : Teacher, c : Class] {\n \tt->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uZzWkKTBydF7ahEEA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:30:51"} {"_id": "acfE3KorMuX2seHdx", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HhPjqbuN97uz6hPoc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 20:27:37"} {"_id": "NP7SXTTM5CP8GHAK4", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Person | some c : Class, g : Group | c->p->g in Groups | some q : Person | q->c in Teaches implies q->p in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rp3c9Wp7HaTMuPm5H", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 15:50:54"} {"_id": "hoSviiC2SzvNGDyAC", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class|some t:Teacher,g:Group | t->c in Teaches and one s.(c.Groups).g and one t.(c.Groups) implies t in s.^Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "BEdy4ZJD5ZrZ69vcH", "msg": "This cannot be a legal relational join where\nleft hand side is s . c . (this/Class <: Groups) (type = {this/Group})\nright hand side is g (type = {this/Group})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 11:38:44"} {"_id": "KLRAXo4gg7LZLKu8i", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JHZsCRAvydiajNXgW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 10:28:30"} {"_id": "MJaCtDRsiuDy27HAg", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some p : Person | some g : Group | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sfBD9JxoNdB4gQbDY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 20:39:54"} {"_id": "JYsZ2bK7DjqkmavRE", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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, t : Person | (t -> c in Teaches) implies (all p : Person, g : Group | c -> p -> g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9rBLXm2CWkyMv98AH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:06:15"} {"_id": "MpPRmJATqj67iyPJx", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 10:11:12"} {"_id": "NoYwxYP77eYeqyALL", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some t : Teacher | some s : Student | some g : Group | c->s->g in Groups and t->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PvC8Z9LLEZkWbeasj", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:22:53"} {"_id": "RMmHKZ8gvt6uv5QRB", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher,c:Class,g:Class | (t->c in Teaches) implies (t->g not in Teaches)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t=p\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,t:Teacher,g:Group,s:Student | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher, c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MmW6rg7kNGLjbSDR7", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:50:20"} {"_id": "NpceMoDS7PkvAzfdu", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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 Tecahes.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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Dpotrbm9jwGRsGCz9", "msg": "The name \"Tecahes\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 17:57:37"} {"_id": "bavHaLR9btgATtT8e", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c:Class, t:Teacher, g:Group, p:Person | t->c not in Teaches implies c->p->g in Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jeC28X2N8M3YeEaL8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 17:55:22"} {"_id": "2i2SqsehZNhqqTSHX", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p,q,r : Person | (p->q in Tutors or q->p in Tutors or q->r in Tutors or r->q in Tutors \n \t\t\t\t\t or r->p in Tutors or p->r in Tutors)\n \t\t\t\t\t\t or (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "Dy578PHXoADbABCiN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 20:33:12"} {"_id": "C8eJfRyewP9Ke8WbQ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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. */\n\npred inv11 {\n \n all g:Group, c:Class | some p:Person | c->p->g in Groups implies p in Teacher\n \n\t\n \n \n \n \n \n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Kv6vG76h5XiELWztg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 14:29:09"} {"_id": "ZotXTjQovW6ifxXna", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlone 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XNExMMAp9TDA52FDN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-10 17:46:44"} {"_id": "fG8nYmWJCgtHtvpfv", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\t\n\n\n\tall c:Class |some t:Teacher | t in c.Groups.Group\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "XdznEciNrBPygzRAN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:14:40"} {"_id": "TpjCjfcmux7SqvSZi", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p,q,r : Person | (p->q in Tutors or q->p in Tutors or q->r in Tutors or r->q in Tutors \n \t\t\t\t\t or r->p in Tutors or p->r in Tutors)\n \t\t\t\t\t\t and (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "uuTbAoSkWMHtpJLRk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 20:33:36"} {"_id": "F4db4b3CiQQkS8Qgo", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\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\t\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "otC2Dct5WsQv8aW28", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-3 10:46:03"} {"_id": "FXeaMEXhk7cMBzq9t", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class 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 | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zkcCew4NAjtL9yWuP", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:17:47"} {"_id": "o6XYroyJqe9wScfCx", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student,t:Teacher | some s.(c.Groups) and some t.(c.Groups) \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "yhziqF8gpF5bMA9RG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 14:53:46"} {"_id": "ZrcALeQionN2C5QaY", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kSCCc4krFGvixZ8sq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-3 10:12:44"} {"_id": "ETWeK6u56RkYE3v7v", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\t\n\n\n\tall c:Class | some Groups.Person \n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "QbfmKpoFRy4GkqqZ9", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:17:19"} {"_id": "qEYsZ6WqPubHpPfpt", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Teacher | some c:Class | p->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c:Class | t->c in Teaches implies c=1\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fvxBZHmMyc33AaA4L", "msg": "== is redundant, because the left and right expressions are always disjoint.\nLeft type = {this/Class}\nRight type = {Int}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-28 21:52:40"} {"_id": "wZohtDsLsKYv3fPNM", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall t : Teacher | t not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | some c1,c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}\n\n\n", "derivationOf": "gmmALo6piFikMLRXG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-18 17:33:05"} {"_id": "5A5FAcQ79maWsAH97", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bmBzEGWFoj2L7Lmtw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 12:13:50"} {"_id": "8ca2p9HKZqMxpBYg7", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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 all c:Class,g:Group | some p:Person,t:Teacher | c->p->g in Groups implies c->t->g in Groups\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "yeb4danEbSTkThyia", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:50:10"} {"_id": "RBguQ2qaGesNBSrPy", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zdPcEQexfcoPPgLHB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 10:30:28"} {"_id": "ZLEcx2qc5sYgf56T3", "cmd_i": 6, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* 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\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\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\t\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "CoQ7YxKxSqwzJHp2h", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:35:33"} {"_id": "n4S2Hh5xPpacbHMC6", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class, s:Student, g: Group | some t: Teacher | (c->t not in Teaches) implies c->s->g not in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cWgwE2a8Rb8hqs7BS", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Person}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-30 22:15:57"} {"_id": "ChLxCkJA2q3bCoS2Y", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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 t : Teacher | (some p : Person, g : Group | c -> p -> g in Groups) implies t -> c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LDwMo2jFqH62cpK3A", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 09:57:53"} {"_id": "rv9rnS2ps63jWhqAc", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 11:20:15"} {"_id": "jrbFZsMempnKuY6Sw", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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. */\n\npred inv11 {\n \n all g:Group, c:Class | some p:Person | c->p->g in Groups implies p in Teacher\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "C8eJfRyewP9Ke8WbQ", "original": "YH3ANm7Y5Qe5dSYem", "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": "Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "Student:Person"}, {"parent": "Person", "type": "Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 666, "y": 132.66666666666666}, "Class1": {"x": 444, "y": 132.66666666666666}, "Class2": {"x": 177.60000000000002, "y": 265.3333333333333}, "Group0": {"x": 355.2, "y": 265.3333333333333}, "Group1": {"x": 532.8, "y": 265.3333333333333}, "Group2": {"x": 710.4, "y": 265.3333333333333}, "Person": {"x": 222, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}]}}, "time": "2019-10-2 14:30:22"} {"_id": "ZvrHgJvRzGnEXz9Yi", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : class | t->c in Teaches implies some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "msg": "The name \"class\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 15:25:44"} {"_id": "SEKE8gm4QAL8q3m5W", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "vAsZfLERGQun5HHPn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:19:26"} {"_id": "difX2WKCyZ8uPrqQ9", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class , t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c,d:Class | t->c in Teaches and t->d in Teaches implies c=d\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FHr96gsddTubeSxzz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:32:59"} {"_id": "RGbav3Dw9Zg5brHHy", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall Teacher.Teacher | one Teacher \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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sy3zGGgKvfCTZzyAj", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:53:37"} {"_id": "ShKX2pNPRb3KGMbZA", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n \n all c:Class,s:Student,t:Teacher, g:Group| some s.(c.Groups)->g and some t.(c.Groups)->g implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "roX7tPFMGWSEXQZhC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 21:17:48"} {"_id": "grJW9KWpwMba27LxY", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rTZsw46aqbLPJpipp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 13:06:59"} {"_id": "zLNg6A765QWbXvDNw", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors \n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:08:37"} {"_id": "jqXPZugyFfHhazzeE", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \tall p, q : Person, c : Class | (some g : Group | c->p->g in Groups) and q->c in Teaches implies q->p in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tsome p,q,r : Person | (p in Teacher or q in Teacher or r in Teacher) implies (p->q in Tutors or q->p in Tutors) and (q->r in Tutors or r->q in Tutors) and (p->r in Tutors or r-> in Tutors) \n}", "derivationOf": "LRTsiXo6X8fHtkQRs", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 16:07:15"} {"_id": "86uLKKfDKDKeHqZZS", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Teacher | some c:Class | p->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c:Class | t->c in Teaches implies one c\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \tall t:Teacher,s:Student,c:Class | some g:Group | c->s->g in Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hdtgLACLygJTN2WeN", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-28 22:04:10"} {"_id": "NzfW3iAp6FAXWRaCz", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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 g : Group, s : Person | c -> s -> g in Groups) implies some t : Teacher | t -> c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Person, c : Class, t : Person, g : Group | (c -> s -> g in Groups) and t -> c in Teaches implies t -> s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n all p1, p2, p3 : Person | p1 -> p2 in Tutors and p2 -> p3 in Tutors and p1 in Teacher\n}", "derivationOf": "8dTfKqTs26w6fL87K", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:33:44"} {"_id": "xfGKobHqqCGW4Pfak", "cmd_i": 2, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* 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 (Student && Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "udx8keDFLzALdp54D", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 21:20:41"} {"_id": "k5Hisq5eHGCaKZFfh", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class , 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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t Person.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "pbkGEZhPpCeY5Mewh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-1 18:29:40"} {"_id": "LWm3bqChmkH9GukiW", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.*Tutors\n}", "derivationOf": "WhhQ8teeco7oS76aa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:47:05"} {"_id": "2ACBt6wKCXpZaDLCK", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall p, q : Person, c : Class | (some g : Group | c->p->g in Groups) and q->c in Teaches implies q->p in Tutors \n \n \t\n\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nM9QXhvQMrZKo8e96", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 15:59:28"} {"_id": "qeE6724CtcypcLBtM", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2TCRjHyEktM7LpmQz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-13 16:11:35"} {"_id": "LCHFEdY7d7GsrksKi", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n \tall p:Person | p not in Teacher \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t1,t2:Teacher | some c1,c2:Class | t1->c1 in Teaches and t1->c2 in Teaches implies c1=c2 | t1->c in Teaches and t2->c1 in Teaches implies t1=t2 | \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BEv3jmM9hSfRmcr5t", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-28 17:00:55"} {"_id": "457KoMKuyRjDcpRC9", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlone Teacher in Teacher.Teaches \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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wX2pdnE453HnCYCCz", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:50:18"} {"_id": "XF5D9t7Wsiuvk4vjf", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher, some c:Class,g:Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "TikDPAjpGx6fgZBqt", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 20:55:25"} {"_id": "pZdStqH9Gifwf2vys", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "26zQNscBsyC5uxWLb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 10:15:56"} {"_id": "Nf9vjz93FQ3B9jLCD", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "eNYDcZHhE6Gktzv2R", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-10 15:00:17"} {"_id": "ZEwXfGY7qB94qTYc2", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n iden & Teacher in (Teacher.Teaches).~(Teacher.Teaches)\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GmFX4oCmgCL6Kou55", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {univ->univ}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 17:25:06"} {"_id": "PAuTGLW2quxcGkegJ", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wLeLQ2YcwStoN6icv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-1 09:47:59"} {"_id": "G9WHNkenz4i3yuCti", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MTnhBQopkerqyFR7p", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 09:43:18"} {"_id": "JJMx497ERksrjM5qi", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n \n all c:Class,s:Student,t:Teacher, g:Group| some s.(c.Groups)->g and some t.(c.Groups)->g implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "RPiaiJqr3383KxsK4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 21:17:59"} {"_id": "wgCjn8KA2oGdqsvRL", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher,c:Class,g:Class | (t->c in Teaches) implies (t->g not in Teaches)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t,p:Teacher, c:Class | (t->c in Teaches) implies (p->c not in Teaches)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hP94XARWn6WEdCSDG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:32:38"} {"_id": "pDfDdHXzjfbSNhotZ", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall p1:Person | isTutored [p1] implies p1 in Student\n}\n\npred isTutored (p1:Person){\n\tsome p2:Person | p1->p2 in Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cx3YEuvTtbtC8niBG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 18:08:18"} {"_id": "T899hDTZrH4mpQWB5", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\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\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "82xRYki2Y4wzKcjDr", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:42:41"} {"_id": "tgWceDjMtpyPqLgHS", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher, some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "phcTq4w4pNL9zkH3h", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-2 23:56:55"} {"_id": "39n9JDvAeJDp4HWke", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "b3u28RvNbHyjtxKj8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-2 23:45:06"} {"_id": "v7JALfW9sGmPMw9vg", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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 \tlone 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KryQyQhaS6gMKp4MN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 20:33:57"} {"_id": "bvBKEFGCj4BYt8rcj", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,t1,t2:Teaches | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PQqqZacPiBbXNeYQW", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 10:49:56"} {"_id": "TD7t5GhN5HqYQ55TH", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | t1,t2:Teacher | some 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BgMFSawMqBu4SqT9L", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 10:31:28"} {"_id": "o38KvADtQj3KpSgu4", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches implies some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZvrHgJvRzGnEXz9Yi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:25:58"} {"_id": "3appas8mTCoN2EE29", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class , 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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Y8yR4sm2JNRAhoBRh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-12-1 18:25:17"} {"_id": "BcZyS7xzWNEA4QfdL", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SoaSN84AKsJjaSC8n", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-10 14:50:41"} {"_id": "zLxY2iBoT74WuAY2k", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SS5P47J2qcYic6r3F", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:29:19"} {"_id": "tpCuC5hftcQguHmFu", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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 t : Person, c : Class | (some g : Group, s : Person | c -> s -> g in Groups) implies t -> c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Person, c : Class, t : Person, g : Group | (c -> s -> g in Groups) and t -> c in Teaches implies t -> s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n some p1, p2, p3 : Person | p1 -> p2 in Tutors and p2 -> p3 in Tutors and p1 in Teacher\n \n}", "derivationOf": "fbEouTLkoTWozTaEY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:27:30"} {"_id": "tWNgXc8ww4S4DkJhy", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n \tall p:Person | p not in Teacher \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student or p in Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "77xxu6T6mjzExW2TX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-28 16:44:25"} {"_id": "qKpDHdd6jWQ8pg4ot", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PW3yYST8YNFAx6gaH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:56:51"} {"_id": "W9z4s9CCQRx2GSdPN", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Person,c:Class,g:Group | p in Teacher implies c->p->g\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kWZmKpJxgCZNawoF8", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:26:09"} {"_id": "ZpPCHijK8K9ujEB5h", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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 in Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "avDh7HoWXgrXGhDcY", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 17:58:30"} {"_id": "BsmrvoKK5zctHFxab", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JA2o5NvTSTXfxSrir", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 09:48:43"} {"_id": "cZ8Yr458p2qKN6dND", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Person | some c : Class, g : Group | c->p->g in Groups implies some t : Teacher | t->c in Teaches and t->p in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ENAmZku3YFynpEWkh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:42:27"} {"_id": "qQNJaytD44KpEwwcf", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "X4LfaRRoq3wTTh6dL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 15:00:06"} {"_id": "fhGrGT6zWfcrHZKGz", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group,p:Person |some t:Teacher| c->p->g in Groups implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "zfwR6EJHxMNS22EDh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:04:21"} {"_id": "wcefQFwxR6sgmuA9F", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teaches.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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DW8FKp4XL6dm5gTNE", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-2 15:37:53"} {"_id": "F9uvW8rhKGLNuvDy6", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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 g : Group, s : Person | c -> s -> g in Groups) implies some t : Teacher | t -> c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Person, c : Class, t : Person, g : Group | (c -> s -> g in Groups) and t -> c in Teaches implies t -> s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n some p1, p2, p3 : Person | p1 -> p2 in Tutors and p2 -> p3 in Tutors and p1 in Teacher\n \n}", "derivationOf": "3SxYJRiH8stfuntkE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:31:49"} {"_id": "yr9tRHQxWmbygSMFN", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p:Person,t:Teacher,s:Student | s->p not in Tutors and p->t not in Tutors and t->s in Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5Bz33eYmGLnEjJq4u", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 17:25:48"} {"_id": "S5a6XcYwnwMkvwh23", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t.teahes 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YyJa2kBDCA4JLhZLq", "msg": "The name \"teahes\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 23:57:02"} {"_id": "6DvsLNJT4Z2xzdMDw", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\tall c:Class,g:Group | some t:Teacher | some (c.Groups).g \n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "MGYPEKxiEDPLqgLf6", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:09:04"} {"_id": "tvaatMZ2EHhHbkf5f", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | c->t in Teaches \n}\n\n\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ELHDviMn2ou7xvrR7", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Person}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-3 00:20:24"} {"_id": "FPqEfbMcyXjnetAbY", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teachs\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7f6gF9ygn2GXegvjh", "msg": "The name \"Teachs\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 21:16:30"} {"_id": "HJyt5uwbyt6Kn8dbB", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class,g:Group |some t:Teacher | some c.Groups.Person \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "BmyyypSoGkuLJr8XD", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:03:01"} {"_id": "9nQZ2HG42kFrTCvXh", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FNvRkbTBBXJcGRf69", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 22:03:56"} {"_id": "jsKFCrWakKKHPxHkt", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n \n all c:Class,s:Student,t:Teacher, g:Group| some s.(c.Groups)->g and some t.(c.Groups)->g implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "oKjJRzxnG6vWPJxZY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 21:17:52"} {"_id": "ha9hPfSQaNTTk7kZ8", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n \n all c:Class,s:Student,t:Teacher, g:Group| some s.(c.Groups)->g and some t.(c.Groups)->g implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "JJMx497ERksrjM5qi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 21:18:02"} {"_id": "GRn3PknhhJkKL4wSp", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t all c : Class| some t : Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2 : Teacher, c : Class | t1->c in Teaches implies t2->c not 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "J2uhZphH75N53kgu3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-9 00:19:50"} {"_id": "j6xFghP4oFcQLZMpK", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p,q,r : Person | (p->q in Tutors or q->p in Tutors or q->r in Tutors or r->q in Tutors \n \t\t\t\t\t or r->p in Tutors or p->r in Tutors)\n \t\t\t\t\t\t implies (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "FDZWWpTRmBZD3r73Z", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 20:30:23"} {"_id": "47mSNNvLEuXZ3hut2", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | ((some g : Group | c->s->g in Groups) and t->c in Teaches) implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xbgAGxLRBAwgbtjYp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 12:55:22"} {"_id": "m6x5YSqoAezCdQiQJ", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:46:14"} {"_id": "dfYDGZ8dCRs5Ya9mf", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class |some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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\tall c:Class | some Person.(c.Groups) implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rppXtnpCMY9xknysp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:43:44"} {"_id": "gf5svrT7qgpxXC4Jg", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall t : Teacher | t not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}\n\n\n", "derivationOf": "wZohtDsLsKYv3fPNM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-18 17:33:28"} {"_id": "i7HJKMZrX34A9qnMb", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DHCtRkmNWNH42XQZA", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:13:21"} {"_id": "6CC5sasXAxbWGmScs", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class, s : Student, g : Group | some t : Teacher | t->c in Teaches implies c->s->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HoFjjMpQyf3kESRZe", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:44:07"} {"_id": "Lc3JQDHof4TzZp7NM", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NTFaf7gGyKkyN94jM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 17:58:29"} {"_id": "BdpWjcDBvzdKytWxi", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \t\n \n \t\n \tall t:Teacher | some c:Class,g:Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "QybxSMTjPundbwvJi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 10:54:52"} {"_id": "B53GN5BAKs4MNeqcM", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "e4ohGMSqMnoTzt9rC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 09:12:57"} {"_id": "NDFRxmWcyi7T4G3c5", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 \tall c:Class,t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "F4GeM3LNPebYhZf6X", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 09:26:03"} {"_id": "XnTAjRtTSKGNeKdzN", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "B53GN5BAKs4MNeqcM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 09:13:19"} {"_id": "FGiDJqJ93YdC6hvLM", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QHF8E3fRSYZAxpSWG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 13:11:13"} {"_id": "R8rgGG6L6JR8ABbcW", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PJXw5duz7ANf2Z7Jh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-1 17:29:50"} {"_id": "bE5F4LnM9jp44CPEE", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall t : Teacher | t not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2 : Teacher, c : Class | t1 -> c in Teaches and t2 -> c in Teaches implies t1 = t2\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | c -> (s -> Groups) in Groups\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}\n\n\n", "derivationOf": "AQo9gnzupvkPkDEEN", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person->this/Class->this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-18 17:37:03"} {"_id": "JhPS8RzkGup9rB2Df", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n \tall c:Class | some t:Teacher | some c.Groups implies t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "gtqszdpgJuo6DCF3a", "msg": "The name \"g\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 12:07:02"} {"_id": "ZNPHyDTAwMRjjSK2M", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | studentInClass[s,c] implies some p : Teacher | p->s in Tutors and p->c in Teaches\n}\n\npred studentInClass[s:Student,c:Class] {\n\tsome g:Group | c->s->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hsbdi95ZZtks7pDJJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:59:13"} {"_id": "DuFWf5GXiLX8Pm8mk", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vpTzJnPMcah7tMXTd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:28:48"} {"_id": "SWfwXA5XhFPP3gDFi", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c->t 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SWK5cpWeeXtyLn4Fk", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Person}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:42:56"} {"_id": "PkkogoTnvHhXuPP7w", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | some c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wmwzxE2vGJon4JdFo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-3 00:02:48"} {"_id": "qNMR4fbbTZhRDdYTK", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | (some c : Class, g : Group | c->s->g in Groups) implies some t : Teacher | t->s in Tutors and t->c in Teaches\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gFjS9wkDCBAsA2krw", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 21:20:34"} {"_id": "RQTSGKw4wKfTTZAbo", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tF8g56RN9eF2xPAzH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-21 16:45:29"} {"_id": "oY8i5XSiToqE5sApN", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\nall t : Teacher | some g : Group, c : Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\nall x,y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\nall s : Student | s in Class implies some t : Teacher | t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bgj7EcNXMsemaed9u", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:35:32"} {"_id": "rbyM5jKAx94kFDvbz", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "cbLxGhgQFJmf3Df4o", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:20:25"} {"_id": "WLhf58X5Ms9AcpfmB", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Dh88mLSZi3SNpb6jX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:29:27"} {"_id": "geXiD4vxL64Gvt9Ks", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Teaches\n}", "derivationOf": "X9aWuid2ySgZyWJ2s", "msg": "^ ~ (this/Person <: Teaches) is redundant since its domain and range are disjoint: {this/Class->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 14:45:59"} {"_id": "WLTxhtnbos8kYPtoM", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gkS3vmw7feHjiKxez", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 09:15:02"} {"_id": "cWgwE2a8Rb8hqs7BS", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class, s:Student, g: Group | some t: Teachers | (c->t not in Teaches) implies c->s->g not in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hhtggh7bsuWvtdoPY", "msg": "The name \"Teachers\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-30 22:15:48"} {"_id": "5wMXvP6Z5ckSKnnhx", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\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\tall c:Class,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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "Nf9vjz93FQ3B9jLCD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-10 15:00:26"} {"_id": "Ej5AGZ9ejuM726EYp", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher & Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "msg": "& is irrelevant because the two subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 21:15:36"} {"_id": "28BwvP45Xe27iahQC", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n \tall p:Person | p not in Teacher \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher, some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aatmdScSRnB2WhE5G", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-28 16:51:43"} {"_id": "PDMpbGGAX3sePYBqp", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p: Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | t->c \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qCbRh5mAGqEj5RAji", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:31:01"} {"_id": "hSiXAktZoC3FP2NYE", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall t : Teacher | t not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | not (p in Teacher and p in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cgiarpPbNswQkCH5P", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-18 16:51:57"} {"_id": "sq2WvsytTy3KcYnhY", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall t : Teacher | (some x,y : Class | t->x in Teaches and t->y in Teaches) implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gLWyqRe3i8C3EHMSp", "msg": "The name \"x\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 20:31:15"} {"_id": "RirmgHjgnDYQi5b93", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "ozJg8mTLxXx2kCWZy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:25:05"} {"_id": "TXhgCM9pjTR9eAP4t", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class| some t:Teacher | some c.Groups.t implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "N6BdRci9X9HpedZJc", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:02:07"} {"_id": "KpRY2AaTjqgAdurfP", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "zf2NMEgNpYzbGtqRk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 21:22:12"} {"_id": "BWMtX6NDAfzZZRxxX", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:14:38"} {"_id": "Dpotrbm9jwGRsGCz9", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\tTeacher 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Resz4TfGywkpQjGn9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-10 17:56:13"} {"_id": "MGzd24BRN595oD7hk", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NExh6WCuDXYMYvf4R", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 12:00:25"} {"_id": "otqN7KCeE7y6dDC4N", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZjpHS7bTS85NgSsMA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 09:36:22"} {"_id": "A23No9zEvZeKWRYWL", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n some t : Teacher | some c : Class | some s : Student | some g : Group | t->c->s->g in Groups implies\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ixf5XkzXXvJsr4btn", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:21:29"} {"_id": "w823eH7Lobc4HAujC", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:40:05"} {"_id": "7P4TSndnbdbeeD9XM", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "TpcySFpiKdFSezAYc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-13 17:04:18"} {"_id": "fPWW6ENx8XFkR9T4F", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | some t : Teacher | t->c \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SarcGx6X64nMKe2ND", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:38:03"} {"_id": "3N2B67GgAy96Ydpz8", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bN4Ej5LrvBLT383Ws", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 21:11:05"} {"_id": "w9fh6nJRcFsRyDaJa", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x,y : Person | x->y 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NvbfyA2jDAueXjcix", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:14:11"} {"_id": "cGg3wrXdd7DZRCxzT", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tin Person\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bDwnCy3Qktdckxzvi", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:14:17"} {"_id": "7i9g6YpruGnMvL7u7", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qYm5uWaQ5gy3KQ3Ja", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 20:41:27"} {"_id": "ESMy5pNeT96sfrwBX", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "4DmBDdJhWp2GyaEyp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 15:49:27"} {"_id": "ejF43btrk3nEfFsZt", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qeE6724CtcypcLBtM", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-13 16:12:23"} {"_id": "MmW6rg7kNGLjbSDR7", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher,c:Class,g:Class | (t->c in Teaches) implies (t->g not in Teaches)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t,p:Teacher, c:Class | (t->c in Teaches) implies (p->c not in Teaches)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,t:Teacher,g:Group,s:Student | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wgCjn8KA2oGdqsvRL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:35:34"} {"_id": "pTpsYoyoaGYa2E2xL", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n \tall p:Person | p not in Teacher \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ozayx89o7eJYGPhSd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-28 16:53:04"} {"_id": "tYayPnks3cwFdthyF", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | all s:Student , g:Groups | s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "phx4QAKGTadCCzd8d", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class->this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:13:22"} {"_id": "QNrnABbThw6x73WQe", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c :Class, s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kt25K7yvj7q4EwM5T", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 22:38:37"} {"_id": "FiNn69ozg4kbGA6td", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Person, c : Class, t : Person | ((some g : Group | c->s->g in Groups) and t->c in Teaches) implies t->s in Tutors \n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jgYSbne6cYdwPgiiw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 15:10:08"} {"_id": "uvoqqmHC3czboYHvL", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class,t:Teacher | s in c.Groups.Group and t->c in Teaches\n\n }\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "RKmozHo8yFkH9HJSp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-12-2 11:45:24"} {"_id": "gKoYt9kCTA6QauLiC", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "Aoga73g9HnpXavzvQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-13 17:02:55"} {"_id": "7mQa4xnNiQrbaiBTm", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\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,c1,c2:Class | c1 in t.Teaches and c2 in t.Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Q8Wtp43acRpgd9Xws", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:30:11"} {"_id": "B6bQdCaDDSnmWQw6v", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n \n all c:Class,s:Student,t:Teacher, g:Group| some s.(c.Groups)->g and some t.(c.Groups)->g implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "jsKFCrWakKKHPxHkt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 21:17:55"} {"_id": "kpRNtiZR45yjwYSmo", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Person | x in Teacher and x in Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nsome x : Person | x in Teacher and x 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "e4yrDSXwujyLKrm7i", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:16:31"} {"_id": "ib5g9FmL84oxzGhM3", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Person | some c : Class, g : Group | c->p->g in Groups implies some q : Person | q->p in Tutors and q->c in Teaches\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nS3kg9iaiSFAfXtLJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:54:30"} {"_id": "9EPouNQrW2oZyYKR8", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ypHR73gfJi7zZ4xQ5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 10:30:41"} {"_id": "obRpWBuoKiJdBCSyr", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some g:Group,t:Teacher | c->t->g in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "h9qgANFcAgKJAi787", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 17:14:59"} {"_id": "DpXXFvTMuowmTD7QD", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class , y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall x : Class | some y : Person | some g : Group | x->y->g in Groups implies y in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xj8fDZvYjDyX2PzQe", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:48:28"} {"_id": "xzYsWDTnDEprtHsE4", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student or p in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9BGgQZ9Dmafv7phqt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:28:02"} {"_id": "H5gFwKmGrocQuEWDk", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NPXL3NaZBmm4YYnus", "msg": "The name \"teaches\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:41:16"} {"_id": "zbHbznJnujWR8e7DR", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\n \t\n \tall c:Class,t:Teacher | ~Teaches.t\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\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n \t\n}", "derivationOf": "JDcnnLwDmdJYYRffW", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 20:25:42"} {"_id": "w92WZBLqs6QhHyPuN", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies 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 Person.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "YEiMsu9i83Mcpm7TD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 21:18:49"} {"_id": "sanu33sG6w5utMT3r", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors \n}", "derivationOf": "F3Q4X5BDsXLZZj5rq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 10:01:24"} {"_id": "ohHEvLEjMPFtir5Jg", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class, s : Student, g : Group | c->s->g in Groups implies (some t : Teacher | t->c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "umsim8WXG3fc3hpiX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:36:25"} {"_id": "KJ2bmS3cYm7Y7YAaj", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SuZYh422JWfJSxPY5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 12:23:40"} {"_id": "tTNjmjSwAeRqfGiqc", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vBD5MjKoyMen5qkz2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-29 16:58:09"} {"_id": "ravbDSJ96nd5ZYu5k", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n all t:Teacher | t not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "y3rQ9YtAbNQEgugwv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:23:53"} {"_id": "gkS3vmw7feHjiKxez", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teasches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9GSkErexG34ZsWfX5", "msg": "The name \"Teasches\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 09:14:57"} {"_id": "uf8yTWBKXgAnxHYWk", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\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\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rxpjszuJZpmw5A7Tb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-4 19:56:33"} {"_id": "BEFEkqGuePxhqyKJT", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 { \n\tall p : Person | some c : Class, g : Group | c->p->g in Groups implies some t : Teacher | t->p in Tutors and t->c in Teaches\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7mWM9gGbSpeaC8A6H", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:44:16"} {"_id": "oFHuDNrTqzQPGtyk6", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\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\t\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "DjvPmXrCoCfNZFn6s", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 10:57:11"} {"_id": "ZjpHS7bTS85NgSsMA", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | c->s in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZMyhezj8kMg6gLzXK", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 09:36:06"} {"_id": "hhtwpHrDotZPvPesd", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-4 17:58:06"} {"_id": "WAGPHevmYHBuekgym", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n \tsome (Teacher 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bwdgBP6jShy9spSQD", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 21:34:30"} {"_id": "6ygkjkARAT4aMZtCT", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher.~Teaches.Teaches in iden\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8NWSjrWA73GbzFEAe", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {none}\nRight type = {univ->univ}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 17:59:59"} {"_id": "QZmSWRNt263nRwwfE", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tall p: Person | p not in Teacher and p not in Student\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Y8ZPbaEQj7A6TH8sQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:31:59"} {"_id": "mMLexmNeN4GHxZbqM", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kPWLLA5rgz5B6KsFH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-4 18:10:12"} {"_id": "r9PY4uaAQng5QpYbw", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tTutors.Tutors.Tutors.Person in Teacher\n}", "derivationOf": "qW6wMMjPce2kCbCNd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 20:53:10"} {"_id": "rSrYDejMD4NE8dNrB", "cmd_i": 12, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall p1:Person | (isTutored [p1] implies p1 in Student and isTutor [p2] implies p2 in Teacher\n}\n\npred isTutored (p1:Person){\n\tsome p2:Person | p2->p1 in Tutors\n}\n \n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pDfDdHXzjfbSNhotZ", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-7 18:09:40"} {"_id": "8ccg7Su6cuKWmJiDp", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\npred inv11 {\n all c:Class,g:Group | some c.Groups.g implies some t:Teacher | t->c in Teaches\n}\n\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "Et3f9QEfu8xjbHFpA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-21 11:41:09"} {"_id": "mG2EkAigxbJuYve8y", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-1 17:26:28"} {"_id": "mtJDsyoD5zttsXJbG", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "7P4TSndnbdbeeD9XM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-13 17:04:21"} {"_id": "34scg9AZu7APgxaqT", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "bDBRjXhHmHZp8kQnh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 15:48:57"} {"_id": "5KGXSnxKqTjmoFQE9", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dgTwupu5e8G6fe6E8", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-7 17:41:17"} {"_id": "k9QCvg5PtqFvMRKME", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \n all c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bqeYDYzm9pTYbFWuy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 11:30:10"} {"_id": "NTFaf7gGyKkyN94jM", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kbLnKWHQArw5ffH7c", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 17:58:16"} {"_id": "aKPFPPEJ8YG9uEviF", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c:Class, t:Teacher, g:Group | t->c in Teaches implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vDDfhdY6K5rbuv2zH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 17:49:52"} {"_id": "yySYgobbHPy5pq8JH", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | one Teacher in Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tTeacher.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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gtAvc4DRhE2nn2Nuy", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:40:52"} {"_id": "pxaGKTCgM6oNT6GJj", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 or Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JtPaFMrJjRJYgJciT", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 21:21:31"} {"_id": "rMNa7JesKfCj4kQcJ", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Teaches.Teaches.Teaches in Teacher\n}", "derivationOf": "P7W9z9ffCubTWN2iF", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 20:51:56"} {"_id": "7tYjvuiox9TSAE7k6", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 all c : Class | all s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all t : Teacher | (t -> c not in Teaches) implies (all p : Person, g : Group | c -> p -> g not in Groups) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Person, c : Class, t : Person, g : Group | (c -> s -> g in Groups) and t -> c in Teaches implies t -> s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WifFjpskvtkSFDTPT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:20:20"} {"_id": "gfszPhgnr4rhWGJ9n", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\t~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "db5KTK9dEiK5KhxPv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-10 18:29:39"} {"_id": "STmsyn6LJjfrkMv4L", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "i2t6XBtY8yvv7q48r", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:26:40"} {"_id": "cc38q8u4H2mfKdcCT", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\t\n\n\n\t\n \n \n \n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \tall s:Groups.Group | some Groups\n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "nZunicDH9WTfeYtQg", "msg": "Analysis cannot be performed since it requires higher-order quantification that could not be skolemized.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 12:27:38"} {"_id": "JBBTvcCHAFSovDSB9", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some g:Group,t:Teacher | c->t->g in Groups implies t->c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KqrEhSqGk9h7pB4Jn", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:52:11"} {"_id": "yDbKMHZZ5LzuqvAnQ", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall t : Teacher | t not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t -> c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2 : Teacher, c : Class | t1 -> c in Teaches and t2 -> c in Teaches implies t1 = t2\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}\n\n\n\n\n\n\n\n\n", "derivationOf": "bE5F4LnM9jp44CPEE", "original": "YH3ANm7Y5Qe5dSYem", "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": 465.8854166666667, "y": 199}, "Person": {"x": 232.94270833333331, "y": 199}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "seq/Int"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "this/Student:Person"}, {"color": "inherit", "type": "seq/Int"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "seq/Int"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}, {"type": "this/Student:Person", "visibility": false}]}}, "time": "2020-1-18 17:37:55"} {"_id": "TikDPAjpGx6fgZBqt", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | p.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "r9PY4uaAQng5QpYbw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 20:54:10"} {"_id": "d57Y6rnY8RLywudfp", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "M7DwJ7m8DTiEQEzBs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 23:46:50"} {"_id": "ywTbri7iJENv5w8Ew", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher | some y : Class, z : Group, v : Person | x->y in Teaches and y->v->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n\npred inv14 {\n all x : Person, y : Class, v : Teacher | (all z : Group | y->x->z in Groups) and v->y in Teaches implies v->x in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Zux6XcGER3A7A4mHr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:47:52"} {"_id": "7A5z6FTBY7eQXLrWQ", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xmYfeTmaWFWXBeFdq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-13 16:08:51"} {"_id": "cqg55KHY58aLbDF7z", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LDWW52qB2PDkGPpCK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 21:23:48"} {"_id": "uhvYTdv2nsQ7BJEE3", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4zgQT38n4FWjZ9no5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-30 22:03:53"} {"_id": "Tvv6rpioZG3MYuedj", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-18 16:46:41"} {"_id": "8gSfLFQvfxRrpJK6D", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c:Class | lone Teacher.Teaches.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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2nuFbPsxXtpx9HqJC", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 21:10:20"} {"_id": "B2tFD8rrn6hHmwT8P", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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, t : Person, g : Group | (t -> c not in Teaches) implies c -> p -> g not in Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Person, c : Class, t : Person, g : Group | (c -> s -> g in Groups) and t -> c in Teaches implies t -> s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n some p1, p2, p3 : Person | p1 -> p2 in Tutors and p2 -> p3 in Tutors and p1 in Teacher\n \n}", "derivationOf": "Qioc93EkwofwoDTGK", "msg": "The name \"p\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:23:57"} {"_id": "QpfYrNS2YeW7oHPHm", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XmkA7CjfncRcZEekR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:24:03"} {"_id": "9jWtRQputwATeP2fa", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some p : Person, g : Group | t->p->g in Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QE8jktFjDSTrNqDHf", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person->this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:10:19"} {"_id": "57fnwSMq3BkH5rAZ2", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class,g:Group|some t:Teacher | t->c in Teaches and some s.(c.Groups) and some t.(c.Groups)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "CFKg3Mqgkb2xA8pcC", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:36:25"} {"_id": "rcNvX798N9Q2HKJ4G", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome p:Teacher,c:Class | p->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher,g:Group | t->g \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hLREyRZLkdMf956BC", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-28 21:37:21"} {"_id": "ckREaGh5mghFDZK8f", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group | some t:Teacher | some c.Groups.g implies t->c in Teaches\n}\n\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "qG29p6LRGvpxhHDHM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-21 11:34:52"} {"_id": "nqKitpKqtK6QJ3iZM", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher, c : Class | t->c in Teaches implies some p : Person, g : Group | c->p->g in Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eLxJ39hPQ9TnJtnnH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:20:46"} {"_id": "KTB69ZD9mPBJn3mLh", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student|some t:Teacher, g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n\npred inv12 {\n\tall t:Teacher , s:Student | some g:Group ,c:Class| t->c in Teaches and c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p:Person | p in Tutor implies p in Teacher \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oELfKmiHNrPzWDjtx", "msg": "The name \"Tutor\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:32:58"} {"_id": "wSZYHZv2S9sqs7XRZ", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class | t->c in Teaches implies some p : Person, g : Group | c->p->g in Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4kLLEXKbhoPP7HXRH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:20:26"} {"_id": "wEqej3Ts9tnnxxJzH", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class| some t:Teacher | some c.Groups implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "i9An3Zs3Bxx3HFpps", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:01:33"} {"_id": "4irm6LThE9oL4dAPC", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class , y : Student | some g : Group | x,y,c 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CPXKRRc8G4BrbsyWa", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:42:46"} {"_id": "eKSxpJ2YFeoDspRew", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher | some y : Class, z : Group, v : Person | x->y in Teaches and y->v->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n\npred inv14 {\n all x : Person, y : Class, v : Teacher | (some z : Group | y->x->z in Groups) and v->y in Teaches implies v->x in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dMrahrwg6YnPAYCQr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 15:50:13"} {"_id": "LHqwDw2zgw3v4Tn9y", "cmd_i": 12, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t(no Student in Person^(~Tutors))\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "4X3g7wajuBtAonbW4", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 09:53:54"} {"_id": "98G2ZBqGzSfnNyEAD", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | Teacher.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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kG4jXJA8hypLR9qwK", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 23:59:25"} {"_id": "rg43vdKsmnp83Gdaq", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | some y, z : Teacher | y->c in Teaches and z->c in Teaches implyes z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FHTjZ5cGMLLd4pb46", "msg": "The name \"implyes\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:14:49"} {"_id": "fbFNkFbc5NQ4Nnih6", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vENpG98RQ3Cf2aXYj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 10:16:03"} {"_id": "xmMzQg4YTkDPNQrjb", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall p1, p2:Person | (isTutored [p1] implies p1 not in Teacher) and (isTutor [p2] implies p2 not in Student)\n}\n\npred isTutored (p1:Person){\n\tsome p2:Person | p2->p1 in Tutors\n}\n \npred isTutor (p1:Person){\n\tsome p2:Person | p1->p2 in Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YaZNx3Z26uxSeXaid", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 18:12:05"} {"_id": "9a3wEWm55TdvvYYfS", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "J9gEEg7q58zz7wEQa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 15:49:37"} {"_id": "6csWPtxj9NBu29J2G", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 10:32:47"} {"_id": "YMJbTmgDcSd5szLCb", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class |some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Bj67kKQx4G5sj7Dwn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:39:28"} {"_id": "Frhs8sxb9XHNP2Tzq", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gfszPhgnr4rhWGJ9n", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-10 18:29:48"} {"_id": "L3jiHiDZCGdDfrkdD", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some q,r : Person | (q in Teacher or r in Teacher) and (q->p in Tutors or r->p in Tutors or r->q in Tutors)\n}", "derivationOf": "MenaKJTmorRSrnuhp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 22:05:47"} {"_id": "THnfuqsnCq5yeM6af", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n \tall p : Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class | (some t : Teacher | teaches_class[t,c])\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | (some c : Class | teaches_class[t,c])\n}\n\npred teaches_class[t : Teacher, c : Class] {\n \tt->c in Teaches\n}\n\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GbvkGGivCyXvWEAQh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:33:19"} {"_id": "u3dt5JWh4YD4sAegg", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tall p:Person | p not in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Lc3JQDHof4TzZp7NM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 17:58:51"} {"_id": "MfdxAEjEZMjf88PJ2", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\n \t\n \tall c:Class,t:Teacher | lone t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n \t\n}", "derivationOf": "tHMzxWBkBiLDKM4Hf", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-4 20:26:13"} {"_id": "zWdWPKEQpjbjLYnDS", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | lone t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "RirmgHjgnDYQi5b93", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 11:25:20"} {"_id": "PoEtwyBHkJqNLKzGX", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n \tall p:Person | p not in Teacher \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t1,t2:Teacher | some c1,c2:Class | t1->c1 in Teaches and t2->c1 in Teaches implies t1=t2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Pe7ZkS7EQWtfFhmDx", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-28 17:02:12"} {"_id": "oifBkPyMS4sZ8YRPb", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "ZC8o96euEg3DnbAb8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:18:12"} {"_id": "skFqZCLmnm8Je3ehZ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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. */\n\npred inv11 {\n \n all g:Group, c:Class | some p:Person | c->p->g in Groups implies p in Teacher\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gDQBTL2ghKzQ4qk5w", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 14:30:57"} {"_id": "dtvJ94zXaaR4mJuB6", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p: Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xYe4q97iNNPAPgwyB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:18:30"} {"_id": "w7zmpqgSXPvWPAks3", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PbHrTMywshm7spH3o", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:46:35"} {"_id": "46PLfwkbXLj5qHMNs", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "xCEywwLB3WACzriMt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-13 17:04:29"} {"_id": "oSHta7SBAY7kkfRwh", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class|some t:Teacher | t->c in Teaches and some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "ZqQ3RaM6KsbG3GJi3", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:36:45"} {"_id": "Rh9tEsqHp8xuaQKnE", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | c in t.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\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 | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \tall t:Teacher | some g:Group | Class->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nL8geApFiLC3YgpJE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-21 18:08:59"} {"_id": "Qj7imk73m8c7JHyzh", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t :Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Sus8n5YpnsXJFwErD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:46:42"} {"_id": "tNsgE6dgMrncBEMK7", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GWKFhe5ae8aBwiCyi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-13 16:09:14"} {"_id": "dLkaTbFZ8Jc3yZ9Mu", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlone Teacher.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "P8xCuiWvRWWfWRsy2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-10 17:33:08"} {"_id": "TZbWNW4tq48oP8Sge", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\t\n\n\n\t\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "HrjX9W2Q7FaSc8ZkS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:18:58"} {"_id": "HRsovjGKiozZd8YiW", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student|some t:Teacher, g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher , s:Student | some g:Group ,c:Class| t->c in Teaches and c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6nG5jSupXZTbeBE3r", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:28:56"} {"_id": "vuBHYLnnoAbXY3ixS", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "goSZFFqT5ygD5FP7E", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:24:41"} {"_id": "ofEQk6nSwywWW5brQ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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. */\n\npred inv11 {\n \n all c:Class, g:Group | some p:Person | c->p->g in Groups implies p in Teacher \n \n\t\n \n \n \n \n \n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "G6nQ7RKaX5TA6TY2P", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 14:25:42"} {"_id": "gtAvc4DRhE2nn2Nuy", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone (Teacher in Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tTeacher.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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "H7b9xkpFEbyt6kYJE", "msg": "This expression failed to be typechecked line 87, column 18, filename=/tmp/alloy_heredoc4201078832094144026.als", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:40:24"} {"_id": "6HTdtJLbFxAJCvbi9", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "G75fkNxfsCaBn4t2A", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 20:32:45"} {"_id": "SGCcXR2bGpKE9H2Kf", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student or p in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4WKWdoj8ufKPp66a8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:18:29"} {"_id": "oR6LSvELED6NhzFSH", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall Teacher.Teaches | one Teacher \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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BXc96XyY6w8qdN9t4", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:54:21"} {"_id": "rJYhJfXrN9T2EsZ77", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher.Teaches in Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pqHuS4EL3fma4LiLD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 20:28:08"} {"_id": "8WRqrRMAYkcD2scMZ", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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 | c->s in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EEmua8fHnTNhtybAH", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-3 00:11:27"} {"_id": "qTxFZzazApf8f9TFZ", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, g : Group | t->c in Teaches and c->t->g in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3xwirdoANQYQKfrMh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 20:58:52"} {"_id": "PcyGCaN3PGKNDeo6B", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5vzFGW2oo7Yg8CQ7t", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:20:03"} {"_id": "F59oGGd6tj5aK3cNZ", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n \tall p:Person | p not in Teacher \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SyBWQnzqkqMeHjDzP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-28 16:48:40"} {"_id": "fsQKxRKs4BndiPiNh", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PJh4ZDkXKcaGPhqe5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:10:03"} {"_id": "Zy5gfFDhmr6odt83h", "cmd_c": false, "cmd_i": 0, "cmd_n": "run$1", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\nrun {some Groups}", "derivationOf": "xZskQQQ9NLZrFiT7a", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 13:40:48"} {"_id": "EgXTvaQcaGHo7DuxP", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "odrsnEBkzgEwpZQB4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:26:12"} {"_id": "uML8KG4vWsgDfs4Yu", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 all c : Class | all s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all t : Teacher | (t -> c not in Teaches) implies (all p : Person, g : Group | c -> p -> g not in Groups) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PzXTgfQnRxWSM9m4N", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:11:50"} {"_id": "LsJLox6zHzeDQtZL2", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1,c2:Class,t:Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fDaHhDpSRSA3H643G", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 15:05:17"} {"_id": "XCFbbiWwhbcsC5fay", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "iKrWXMY7a73Z4uEFX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:11:07"} {"_id": "AB7cn2ygP5FZu3gBZ", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hX7dL6QYnPBxzr4d8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 11:14:38"} {"_id": "4RTNC5gtcRgRvBcnB", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class|some t:Teacher | some c.Groups implies t 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sdDaLnSmbomqZnL3R", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 09:39:48"} {"_id": "Cc4LJQXkzamsK34t5", "cmd_i": 11, "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student | all g:Group |some t:Teacher| c->s->g in Groups implies t->c in Teaches\n \n \n \n \n \n all c:Class,g:Group,s:Student | some t:Teacher | ( c->s->g in Groups) implies t->c in Teaches\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t:Teacher | all c:Class |some g:Group | t->c->g in Teaches\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9hGKji4iLKcu6HfR4", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class->this/Group}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 14:10:31"} {"_id": "bzRSRJYjfghFXtn37", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\tClass.Groups \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JDCFzXpMgFuZ9yr2g", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 17:37:12"} {"_id": "8cLbDEBHnf2LdWFRB", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t all c : Class| some t : Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t1,t2 : Teacher | some c : Class | t1->c and t2->c implies t1 = t2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "c9vd2ih9z79JXmcQS", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-9 00:08:03"} {"_id": "FxKFnoyE9byPu3Q8j", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tsome Class.Student.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FaQmzKyGRYAPsNvSZ", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 19:55:53"} {"_id": "qiJgbzwLJqg95xjxC", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MvMR2sKeqw26XP3xr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:26:22"} {"_id": "CFed7Ge8KcxTBooAh", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nPHXrXpeMhAe8Sbac", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:07:42"} {"_id": "sYnf2rd2ZGDLBjKDZ", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "q4c9et97o2XZG8ZNC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:47:37"} {"_id": "vEdr9CxjvRLHu4Zom", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MpPRmJATqj67iyPJx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 10:11:24"} {"_id": "gZCDLXs8WZFbz4mEo", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\t\n \tall c:Class | no Person.(c.Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "hp5LPva8JB3uPFeub", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 17:11:22"} {"_id": "8Qs8S8TMvYo78EzNK", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rgxhhEeNpQBrkN6wE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 11:27:23"} {"_id": "PBAmEdRBpYtTkaLKs", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t all c : Class| some t : Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n }\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Ja5eWNzTRRQfiKruK", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-9 00:25:44"} {"_id": "3spr4qhg7t9zgRouu", "cmd_i": 2, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tTeacher iff not Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pojrP9Rww2tbhZTNF", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 21:19:05"} {"_id": "CoQ7YxKxSqwzJHp2h", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* 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\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9EPouNQrW2oZyYKR8", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:31:34"} {"_id": "C7TXenbWwnBAXrz38", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | s in Class, g : Group | c->s->g in Groups implies some t : Teacher | t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FBu7Q7QBSisQpo8Ri", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 21:07:05"} {"_id": "9WB7Micp2Dj4ffaXM", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1,c2:Class,t:Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c:Class|some t:Teacher, g:Group | t->c in Teaches implies c->t->g in Groups\n \t\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yN2z9Dwe4s5arp6cT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:25:23"} {"_id": "rNPvpat99nYyjhHEG", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class | 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\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LWAiqzBrgLd3wtNXu", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-30 21:56:02"} {"_id": "gsNtHg3tLLeiemFK4", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class, t:Teacher | t->c in Teaches and one s.(c.Groups) and one t.(c.Groups) implies t in s.^Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "4kj6Pz8QbkTniLvH2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:39:14"} {"_id": "WsDxiMtBbaKHhTBmZ", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some g : Group, c : Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SRukYumSZct7wFcQZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-3 00:26:34"} {"_id": "99NtbFuxxmyPaXvPb", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class | some Person.(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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "tt3HFXnYvPvADPBtm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 14:38:52"} {"_id": "yYFiwyztsaN2zGZw8", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\nall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies p in Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "z8Bm4cn7TWrH7TtKv", "msg": "The name \"p\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 11:17:07"} {"_id": "4wGPA7YWtsc9etgeq", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "XuHxbGR9vpq77JZ44", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 15:48:50"} {"_id": "cGJP9Ks4QQv2m5FD3", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\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\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cqbLqJyTduiMgEf8k", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-4 20:01:22"} {"_id": "eLxJ39hPQ9TnJtnnH", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher, all c : Class | t->c in Teaches implies some p : Person, g : Group | c->p->g in Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wSZYHZv2S9sqs7XRZ", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 11:20:40"} {"_id": "Q2vKzFP89ZYSEBh5s", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n some t1:Teacher , t2:Teacher | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2 or (not t1->c and not t2->c)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "g6rbsKv2rr79KNmR3", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:03:26"} {"_id": "uD9xxR7mynvsxfarX", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Person.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "w92WZBLqs6QhHyPuN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 21:19:06"} {"_id": "ZvFPea9weDDEJTuSN", "cmd_i": 6, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 | some 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cLoEASkwiGQmWqydQ", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-13 16:10:48"} {"_id": "mtgFaYTXAbC42XXAS", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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 g : Group, s : Person | c -> s -> g in Groups) implies some t : Teacher | t -> c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Person, c : Class, t : Person, g : Group | (c -> s -> g in Groups) and t -> c in Teaches implies t -> s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n all p1 : Person | (some p2 : Teacher | p2 -> p1 in Tutors) or (some p2, p3 : Person | p2 -> p1 in Tutors and p3 -> p2 in Tutors and p3 in Teacher) or (some p2, p3, p4 : Person | p2 -> p1 in Tutors and p3 -> p2 in Tutors and p4 -> p3 in Tutors and p4 in Teacher)\n}", "derivationOf": "zMAdjAzEm3HaBKcG4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:43:37"} {"_id": "SMxup6K4YXZkE9iLn", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BWMtX6NDAfzZZRxxX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:21:01"} {"_id": "TpcySFpiKdFSezAYc", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "dCJ8HXTZBNhSKpiGR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-13 17:04:16"} {"_id": "zdPcEQexfcoPPgLHB", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kH9paApi6oyHvP4an", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 10:30:22"} {"_id": "EtfFAe6NSD5YWd6w9", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t all c : Class| some t : Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n }\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PBAmEdRBpYtTkaLKs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-9 00:26:00"} {"_id": "PXPQjhLz5wNtfejfK", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall t:Teacher, s:Student | t->s in Tutors and s->t not in Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CyRuF6kWpZyQzWWah", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 18:00:30"} {"_id": "785RPnc3J6ibFa5LD", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 all c : Class | all s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (all t : Teacher | (t -> c not in Teaches)) implies (all p : Person, g : Group | c -> p -> g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hPicTur8shgLc3eHZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:09:33"} {"_id": "wkm2TqDN9FSf8j2tk", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, g : Group | t->c in Teaches and c->t->g in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CbCEKJv6S84nx82QA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 20:58:29"} {"_id": "JvHjDHuFpQJ9uJWCZ", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "trabLBBTuqWJ6jtwY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 10:46:03"} {"_id": "AZv3nyFweq5ceAYJA", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\nall p : Person | some c : Class, g :Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BB7TFQF7S6cJJZJMb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:12:25"} {"_id": "8dTfKqTs26w6fL87K", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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 g : Group, s : Person | c -> s -> g in Groups) implies some t : Teacher | t -> c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Person, c : Class, t : Person, g : Group | (c -> s -> g in Groups) and t -> c in Teaches implies t -> s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n some p1, p2, p3 : Person | p1 -> p2 in Tutors and p2 -> p3 in Tutors and p1 in Teacher\n}", "derivationOf": "F9uvW8rhKGLNuvDy6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:32:38"} {"_id": "vTacu7iG7Kd6NKW3W", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall s:Student,t:Teacher | s!=t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p in Student or p in Teacher\n}\n\n/* There 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\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n all t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "i67xFoQdBDhejb9ax", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:41:25"} {"_id": "kz9FDJXfdHgnmbmGy", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4cxjXu3Fop85YoSn4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 13:17:57"} {"_id": "hjGW5QTdLWAFz7pZR", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tE2Yu6rigpZq56Mro", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 17:32:33"} {"_id": "6hwPa7vQ2kxxtTxaC", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "J2ZhjCa4qFkdbj24G", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-30 18:33:48"} {"_id": "p4yXwmQ68dx4ASrcx", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hP8APmyBESf59ddKu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 21:38:09"} {"_id": "tYzN8x83YJa8XkGXa", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RS4NnSzRTwopgjtmM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 10:50:32"} {"_id": "xZskQQQ9NLZrFiT7a", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 13:40:39"} {"_id": "Xxsi33PJfDfyLEfh2", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SrzsFToHXJcG889Xe", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-1 10:02:45"} {"_id": "Lkp7PxWgQFRBKqDLX", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student,t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in c.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "mHbnvfgTAFBgRpsZT", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 14:53:18"} {"_id": "hwoesC7RcuwriWMui", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher, c:Class | c->t 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3dbotfZWTzrFgjPd3", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Person}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:39:43"} {"_id": "fDaHhDpSRSA3H643G", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1,c2:Class,t:Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xLJ8cCALf2vRQu2wY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 15:03:33"} {"_id": "gMnqzHiZHYjMqHX6T", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n \n \n all c:Class,s:Student,t:Teacher,g:Group| c->s->g in Groups and c in t.Teaches implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "7Qg7t6EMG6YLuvmjy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 13:02:30"} {"_id": "fMBwvstYiwyZ5S8bp", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rzbxdCjpxw6BuaY2B", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:23:01"} {"_id": "fbEouTLkoTWozTaEY", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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 t : Person, c : Class | t -> c in Teaches implies (some g : Group, s : Person | c -> s -> g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Person, c : Class, t : Person, g : Group | (c -> s -> g in Groups) and t -> c in Teaches implies t -> s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n some p1, p2, p3 : Person | p1 -> p2 in Tutors and p2 -> p3 in Tutors and p1 in Teacher\n \n}", "derivationOf": "kYAdjfcbrDyzTquTQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:27:08"} {"_id": "uEoWooCAddxcDSopP", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Q8MCcBvgHFDvs9edm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:30:27"} {"_id": "AJKNB3N2qA5Tk67YK", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student or p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GwwyaMharqbDjea4w", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:32:42"} {"_id": "dWxK5oEAkEHeZ9f79", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 13:49:17"} {"_id": "MvyfuFnwujWKwsJBc", "cmd_i": 10, "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \n \n \n \n \n all c:Class,g:Group | some t:Teacher | ( c->s->g in Groups) implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4PYuRyxdggckeojd6", "msg": "The name \"s\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 11:38:21"} {"_id": "hXDLd7F2fpkQmpotv", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kz9FDJXfdHgnmbmGy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 13:18:07"} {"_id": "ninrh7hSDxHxEYnHc", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "FoAecKXjAfepCbzdt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 13:13:11"} {"_id": "z8DKCB3GjPCe6xKNe", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Teacher | some c:Class | p->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c:Class | t->c in Teaches implies one c\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | s->c->g in Groups implies t->c in Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Fqdj69hXk7MW5pSHL", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person->this/Class->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-28 22:04:52"} {"_id": "NiPmsToXAgeAj7bzP", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class) t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XWXmizg9hzirJqS3t", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:38:20"} {"_id": "GABbRtHRNGxwFD6vQ", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kXhRgf7SnyDLGQXT5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 23:57:38"} {"_id": "xnr6L5zARSwoWroMp", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some q,r : Person, t : Teacher | t->p in Tutors or (q->p in Tutors and t->q in Tutors) or (t->r in Tutors and r->q in Tutors and q->p in Tutors)\n}", "derivationOf": "RrMN96yMYegEhEkT7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 05:55:24"} {"_id": "PiQeDju89iQC4QvS2", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, p : Person, g : Group | c->p->g in Groups implies t->c in Teaches \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Person | some c : Class, g : Group | c->p->g in Groups implies some t : Teacher | t->c in Teaches and t->p in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yfRNtDkHYbio3mBfr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:39:06"} {"_id": "NjPExvsP63cD4FwFP", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n some t1:Teacher , t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2 or (not t1->c in Teaches or not t2->c in Teaches)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9eva2kyGFYJ3gcKEM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:04:58"} {"_id": "wBzQKgTPFPExujEbW", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n \tsome (Teacher in Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tsome (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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Y6w2KboAHyf5TDTN9", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 21:37:35"} {"_id": "TfznC5aYz6QQySXPf", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlone Teacher in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZMx86nGRa9sSSdXXm", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 17:53:29"} {"_id": "RXsuhsBhoCBzSAdmn", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some t : Teacher | t->p in Tutors or (some q : Person | q->p in Tutors and t->q in Tutors)\n}", "derivationOf": "nRpTAPs8Eav2igfjM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-3 05:51:43"} {"_id": "oELfKmiHNrPzWDjtx", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student|some t:Teacher, g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n\npred inv12 {\n\tall t:Teacher , s:Student | some g:Group ,c:Class| t->c in Teaches and c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t:Teacher | t in Tutors \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "meZDyaJsjCQxMYs9m", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:31:39"} {"_id": "7pqMEZMva8pLL7fw8", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "PxMqcyJ25aerogp56", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-21 10:31:50"} {"_id": "5WLPJfHuR934tHFd7", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "G9WHNkenz4i3yuCti", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 09:43:49"} {"_id": "FCqKAQFkBP3s3vBKd", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , g:Group | all s:Student | s in Class \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\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iahHaBt4XAxTYYqMa", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:17:06"} {"_id": "XGwSs3Bi4NQXy3TTx", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class,g:Group | some t:Teacher | c->t->g in Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "uAXCQjuaTkeTcATW4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:58:43"} {"_id": "FBu7Q7QBSisQpo8Ri", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | s in Class implies some t : Teacher | t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XjD9KC2qw3FWeNj4T", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:06:56"} {"_id": "8xfT9tBpSyrhMuShq", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3F3jvZvopi5rkpSMT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 10:27:34"} {"_id": "Sus8n5YpnsXJFwErD", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t :Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1, c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1 : Teacher, t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BaqmEfFs5SuGeaHQ4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:46:28"} {"_id": "DGacWDrR26E4qXgdE", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\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 | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TLYBNju9icsSBhoHW", "msg": "The name \"group\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 11:55:16"} {"_id": "sL8gzbTQi7obpBow5", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Class.Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kmo4Dmwm3M2Fr9oTE", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:30:08"} {"_id": "cHMKd3LHCFFx2yQeX", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n \tall p : Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SMxup6K4YXZkE9iLn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:24:19"} {"_id": "wL4q7RzwNvesL2Wmt", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n \t\n \tall c:Class | some t:Teacher | some c.Groups implies 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "GSYagt4bQWXQdqhtc", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:10:41"} {"_id": "AWizfhyH8NtpSrmkQ", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t all c : Class| some t : Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2 : Teacher, c : Class | t1->c in Teaches an t2->c in Teaches implies t1->t2 not 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GRn3PknhhJkKL4wSp", "msg": "The name \"an\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-9 00:20:30"} {"_id": "vqjxgmgGrz57i4KMZ", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "MESt6ARMw8iWTQCw4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-17 09:44:43"} {"_id": "G7kGRxgAdijA9LwtF", "cmd_i": 12, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student|some t:Teacher, g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n\npred inv12 {\n\tall t:Teacher , s:Student | some g:Group ,c:Class| t->c in Teaches and c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p:Person | p in Tutors implies p in Teacher \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "c2eAXTubo9cZ7A42c", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:33:31"} {"_id": "Zh2u3TmKyQmbTzrvL", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EzcNSLrMXEajHBjEx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 17:18:10"} {"_id": "gcxfbdzyWFFGTWXfN", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n \n all c:Class,s:Student,t:Teacher, g:Group| some s.(c.Groups)->g and some t.(c.Groups)->g implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "YpRiLNn87jcwB7zeX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 21:18:09"} {"_id": "BRkGsDrWL9LKN4yJW", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher, y : Class | some z : Group | y->x->z in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZFcmAhND87gd7SSaj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 13:06:01"} {"_id": "H8pcqsoK7zkJvMKgL", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class , 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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tStudent in Person.^Tutors and Teacher in Person.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "sa8ne94vpQpfeAko5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-12-1 18:27:06"} {"_id": "nL8geApFiLC3YgpJE", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | c in t.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\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 | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some g:Group, t:Teacher | c->Person->g in Groups implies 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "udn2eLFt9uj2frS7k", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-21 18:07:32"} {"_id": "5vzFGW2oo7Yg8CQ7t", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "L4acDGMAFXoA7bBDQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 18:19:32"} {"_id": "4J8sS2Kr8KrhgsN6R", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \talways (all s:Student | s not in Teacher)\n\talways (all t:Teacher | t not in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bBG5gA7WKjjmA5twr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 21:29:18"} {"_id": "eLeQYw8nRwYTkqbQP", "cmd_i": 12, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \tno Student in Person.^(~Tutors)\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "LHqwDw2zgw3v4Tn9y", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 09:54:09"} {"_id": "82xRYki2Y4wzKcjDr", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\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\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\t\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "fzsgkg5vXchtZqJfy", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:41:20"} {"_id": "BthCqLjLTASSv7joz", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \n \n \n \n \n all c:Class,g:Group,s:Student | some t:Teacher | ( c->s->g in Groups) implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Xc38hveHDPZBrDi9h", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 11:39:06"} {"_id": "6HGghxEBH4Xw8k9mb", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, g : Group | c->t->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iv7G8hFaEB6f3rgdG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:37:11"} {"_id": "zt5Y8WKBzRKLQBXvz", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { \n\tsome c : Class | Teacher in Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SGJ7kN5aPnGNt6EHq", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 18:46:16"} {"_id": "bLPD2aWN4A3H8qbvs", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n \tall p:Person | p not in Teacher \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t1,t2:Teacher | some c1,c2:Class | t1->c1 in Teaches and t1->c2 in Teaches implies c1=c2 | t1->c in Teaches and t2->c1 in Teaches implies t1=t2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2ogKPZnqHdgbxkbRr", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-28 17:01:19"} {"_id": "6Q6GY2c5xcy3a3uxQ", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \tClass.~Teaches.Teaches in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8CQTzeSZBFgAFnwkG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-4 18:12:47"} {"_id": "pt9TsQpJcQh4Yzz2e", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zf7nQN8HGKSAcS4rh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 11:30:52"} {"_id": "phx4QAKGTadCCzd8d", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | all s:Student , g:Group | s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JHgB7KJyRrh2uMmJQ", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:12:48"} {"_id": "EEmua8fHnTNhtybAH", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "E8wrYWGQy7kyNCFSk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-3 00:08:39"} {"_id": "rx2jrnqSrPBPCRQRE", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some t : Teacher, c : Class | t->c in Teaches implies t->s in Tutors | some g : Group | c->s->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zGfg5jo3CLK9xuEt3", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 21:28:59"} {"_id": "Pcj6GKkkbCG9SbfTe", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | x->y 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qpAqehMJgQFND4Rug", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:40:19"} {"_id": "9PqKsvgJDmFSGhmsR", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class, s : Person | some g : Group | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Lkhb2ThSWxJ3RSzEs", "msg": "The name \"p\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 20:39:21"} {"_id": "8JoP4NjTuwBwf98EW", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PdsPsmGNwFoyWRTtb", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Person}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:32:09"} {"_id": "KphzxfvRFyeJ8b7T8", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 | some t:Teacher | lone t in Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WfxQGFEBsLA3c6Aiw", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 09:20:25"} {"_id": "ZkohNTkXcv3w9CGNr", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all x : Class, y : Student | (some z : Group | x->y->z in Groups) and some v : Teacher | v->x in Teaches implies v->y in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GE9Bjshn4cFP7Hdxg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 12:37:50"} {"_id": "9voekv7jMBjbFouKT", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "S2hGoPuKWyAvNb2cH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-10 16:39:40"} {"_id": "KH4aQhM83CBNC4jc5", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Person | x in Teacher implies x 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eGt4PDR2NKcAyFKXb", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:26:26"} {"_id": "n8zvJ2bgEXwQttsGY", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "cf72ZcjKoeMD7kuK7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-13 17:03:39"} {"_id": "QpNKfFwen4kf4bi6a", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n Teacher 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jZ3HeZPDmAAzBwwsg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-3 10:28:53"} {"_id": "ERBfgaTL2LzxW7nC6", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\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\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "zAXhhyLbhv8ApXpmT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 10:46:31"} {"_id": "2MGj7zxW8FYqzTMTn", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "4a5QyxtpQLsT6yHew", "original": "YH3ANm7Y5Qe5dSYem", "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": 222, "y": 199}, "Class1": {"x": 444, "y": 199}, "Class2": {"x": 666, "y": 199}, "Group": {"x": 444, "y": 298.5}, "Person": {"x": 444, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "this/Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "this/Teacher:Person"}, {"color": "inherit", "type": "this/Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "this/Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "this/Student:Person", "visibility": false}]}}, "time": "2019-11-11 11:00:16"} {"_id": "4Deevq37auTuNM7PJ", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "k39vM8LaoiPH2HKRS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 12:11:36"} {"_id": "HbWvgetPudLmdLrKw", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | c in t.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\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 | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\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 p1,p2:Person | p2 in p1.Tutors implies p1 in Teacher and p2 in Student \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Rh9tEsqHp8xuaQKnE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-21 18:13:04"} {"_id": "JHbPzWTWvpjCyRQxX", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n some t : Teacher | all c : Class | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "A7JPWeLXSS8ZohkHD", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 17:35:01"} {"_id": "NpjFvAMDJaNH6KDXR", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome p:Teacher,c:Class | p->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cgngrbjKGMhgtWjKp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:38:44"} {"_id": "cgiarpPbNswQkCH5P", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall t : Teacher | t not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Teacher or p in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "K2NKawmK4pbR27p5g", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-18 16:51:19"} {"_id": "h9qgANFcAgKJAi787", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 17:12:25"} {"_id": "4cxjXu3Fop85YoSn4", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XXAdiMCsKb5HejDXC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 13:17:42"} {"_id": "dYyajHWqAwmjEM6SS", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some s : Student | some g : Group | c->s->g in Groups implies (some t : Teacher | t->c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "W6WHF3Zn3uM7F2eu7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:34:04"} {"_id": "WhvKKFvH8q8sCXpaS", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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 all c.Class | some t:Teacher | some c.Teaches implies 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\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "D9kin9dihDunrvQFT", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 12:51:52"} {"_id": "yYWX3gJo6yizhLRSX", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class,t:Teacher | s in c.Groups.Group and t->c in Teaches implies t in s.^~Tutors\n\n }\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "pGvdNo8rywDNkEafT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-12-2 11:46:30"} {"_id": "cNR2XqBYuwdydTFFj", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\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 | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ADDoCdumTaHpyuDaR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-10 14:54:00"} {"_id": "uuTbAoSkWMHtpJLRk", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p,q,r : Person | (p->q in Tutors or q->p in Tutors or q->r in Tutors or r->q in Tutors \n \t\t\t\t\t or r->p in Tutors or p->r in Tutors)\n \t\t\t\t\t\t implies (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "2i2SqsehZNhqqTSHX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 20:33:20"} {"_id": "uPJoj2oQs8vfjoG5Y", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tno Class.Group.~Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "zHj3m7FFeRc87ZZe2", "msg": "This cannot be a legal relational join where\nleft hand side is this/Class (type = {this/Class})\nright hand side is this/Group (type = {this/Group})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 10:22:04"} {"_id": "mKJXDkSnG5qdLAtcu", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher, y : Class | some z : Group | y->x->z in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n all x, y, z : Teacher | x->y in Tutors and y->z in Tutors implies z in Teacher\n\n}", "derivationOf": "WAFjF2mo5ksMGm4dL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 13:11:04"} {"_id": "vDDfhdY6K5rbuv2zH", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c:Class, t:Teacher, g:Group, p:Person | t->c not in Teaches implies c->p->g not in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9gw8ysmpn5YQnWwZ9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 17:49:11"} {"_id": "thPT4E7P5tBABe95h", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | y in Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nXCRRiERcsNFJQxck", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:35:38"} {"_id": "sHNH7mKXMADaeGxSP", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gNdye2NkeAmJcG4Su", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 20:23:35"} {"_id": "hGXNv68aCRwXiYatZ", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some c:Class,t:Teacher | s in c.Groups.Group and t->c in Teaches implies t in s.^~Tutors\n\n }\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "yYWX3gJo6yizhLRSX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-12-2 11:47:24"} {"_id": "oTujnik4vzBHCpjYu", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t:Teacher,s:Student | s->t not in Tutors and t->t not in Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HZYcMWTtiecsjC6Do", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 18:59:00"} {"_id": "z8Bm4cn7TWrH7TtKv", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class, y : Student | some g : Group | x->y->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\nsome p : Person | (some c : Class, g : Group | c->p->g in Groups) implies all t : Teacher | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nMzNJ8D9g7D3BDbzJ", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 11:14:48"} {"_id": "tWXszrRNxqZ9WTWiJ", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8B9FFYjiPeZZXp3vw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-4 17:58:53"} {"_id": "fvxBZHmMyc33AaA4L", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Teacher | some c:Class | p->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZTCSu3Z379NLqSrES", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-28 21:50:25"} {"_id": "wQAfEMNEuK8t9N3yC", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher | some y : Class, z : Group, v : Person | x->y in Teaches and y->v->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n\npred inv14 {\n all x : Person, y : Class, v : Teacher | (some z : Group | y->x->z in Groups) and v->y in Teaches implies v->y in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "L4cp5qG7dsH6Ftyzs", "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": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:52:32"} {"_id": "2s5TMKv8AEns4DFdu", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tTeacher.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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vrPoBihFNYbX3qk36", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:38:23"} {"_id": "sBh5TueM78N7putd7", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fsQKxRKs4BndiPiNh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:10:34"} {"_id": "W4zSyzAt3euAM9jxw", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Person, c : Class, t : Teacher | (all g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Xaev7ba8EDfE7vSrZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 12:54:00"} {"_id": "eE885QQtS4pCiTAtA", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n \n all c:Class,s:Student,t:Teacher, g:Group| some s.(c.Groups)->g and some t.(c.Groups)->g implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "HEwWyL7FrEz9DvBaP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 21:17:41"} {"_id": "7AvZaWt78jqEmTkQC", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WEYewEDYWoSgbsohL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:51:55"} {"_id": "YpRiLNn87jcwB7zeX", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n \n all c:Class,s:Student,t:Teacher, g:Group| some s.(c.Groups)->g and some t.(c.Groups)->g implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "SqPysRNnaP3zsn6Fd", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 21:18:07"} {"_id": "YKfwyrkQ2Hd5gy6iB", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , g:Group | all s:Student | g:Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FCqKAQFkBP3s3vBKd", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:18:58"} {"_id": "yXJFk9596Sq2zKSi7", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p = Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tCyJthGhPatJoz2t2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-21 16:42:50"} {"_id": "rGCvdtF5F84aqiJ3o", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6HTdtJLbFxAJCvbi9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 20:33:51"} {"_id": "r4ythgR2tMaKj9us7", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\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 s.(c.Groups)\n}\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PgC4ZjYLa5kobRRe9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 12:05:27"} {"_id": "eT7KB3AxauptG5ANt", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Student | x in Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "j5GfMaKAQbbtAhAMY", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:36:43"} {"_id": "fYka8qsP6k3wxX5nA", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \tall p, q : Person, c : Class | (some g : Group | c->p->g in Groups) and q->c in Teaches implies q->p in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tsome p,q,r : Person | p->q in Tutors and q->r in Tutors implies (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "5HWMGbrqbhshiBjvp", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 16:03:54"} {"_id": "AJNW8cRXBRvEGW9a2", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher,c:Class,g:Class | (t->c in Teaches) implies (t->g not in Teaches)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,t:Teacher,g:Group,p:Person | c->p->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher, c:Class, s:Student | some g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sBJgCzrPHXqxHZQi7", "original": "YH3ANm7Y5Qe5dSYem", "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": "Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "Student:Person"}, {"parent": "Person", "type": "Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 177.60000000000002, "y": 238.79999999999998}, "Class1": {"x": 355.2, "y": 238.79999999999998}, "Class2": {"x": 532.8, "y": 238.79999999999998}, "Group0": {"x": 222, "y": 318.4}, "Group1": {"x": 444, "y": 318.4}, "Group2": {"x": 666, "y": 318.4}, "Person0": {"x": 710.4, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}]}}, "time": "2019-9-26 10:54:05"} {"_id": "PvC8Z9LLEZkWbeasj", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n some t : Teacher | all c : Class | some s : Student | some g : Group | c->s->g in Groups and t->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "v4YZk5kLzbpzsSsYg", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:22:30"} {"_id": "zv29u76eui9bpc745", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\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 in iden\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YziFnMAvB9mr7ER2T", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class}\nRight type = {univ->univ}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:38:02"} {"_id": "yjpvCR93RvfA4oCs3", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8xTjG8TaKsLWj96s4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 13:09:11"} {"_id": "C99QR9QPCMGMkZQPM", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dkY3CKR7MZsZEd5Gy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:27:05"} {"_id": "FTGTvnEBTwv3Dudf7", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "78PxnyeSzTQDx7Lvg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:21:50"} {"_id": "7KzgkuDqY7Q4ZfQ4Z", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Person | some c : Class, g : Group | c->p->g in Groups implies some q : Person | q->c in Teaches and q->p in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "chEvxt5Ny5ojCAtyF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:47:44"} {"_id": "pRtyhQGLJP2F4Jb9q", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5KGXSnxKqTjmoFQE9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 17:41:31"} {"_id": "qj4ZXGZvzxptumH6d", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,t:Teacher,g:Group | one c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "HKaNFdwRxeHz8k7jm", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:22:55"} {"_id": "bMC8QorYw5GWkjfdP", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9zFH5m9vypqtQrC3E", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-1 09:59:42"} {"_id": "aXrXyGrKytjk9geWw", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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. */\n\npred inv11 {\n \n all c:Class, p : Person, g:Group | c->p->g in Groups implies p in Teacher \n \n\t\n \n \n \n \n \n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4Mv3reeCvogRZFthA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 14:24:53"} {"_id": "FoAecKXjAfepCbzdt", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "SWkxWJTt3zcnyhutf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 13:11:50"} {"_id": "iLREgtJLz68dhcM9M", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome p:Teacher,c:Class | p->c in 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\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class,t:Teacher,s:Student | some g:Group | c->s->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "THxFEcPdLWZs67KwL", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:47:50"} {"_id": "47Y8sdAAfHLcATis5", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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 t : Teacher | (t -> c not in Teaches) implies not (some p : Person, g : Group | c -> p -> g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jQkpGTcpx8KbY68ZQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:04:02"} {"_id": "bpkbn5xhrREXDyaWv", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student|some t:Teacher, g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n\npred inv12 {\n\tall t:Teacher , s:Student | some g:Group ,c:Class| t->c in Teaches and c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1:Person, p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class , t:Teacher, s:Student, g:Group|(c->s->g in Groups and t->c in Teaches) implies t->s in Tutors\n}\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KF4ntyW5hCm97PWoz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:42:24"} {"_id": "9eva2kyGFYJ3gcKEM", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n some t1:Teacher , t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2 or (not t1->c in Teaches and not t2->c in Teaches)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "E52BQrXn68oaK8k5E", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:04:24"} {"_id": "bA4uCN2uwn9dz3eGS", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 12:53:04"} {"_id": "eGt4PDR2NKcAyFKXb", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher | x in Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Person | x in Teacher implies x 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QPxHSfkmSfqWnfHgE", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:26:00"} {"_id": "G75fkNxfsCaBn4t2A", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | some x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sq2WvsytTy3KcYnhY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 20:31:57"} {"_id": "WEYewEDYWoSgbsohL", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Student, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SkQasDZe7SNQYnaYg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:51:39"} {"_id": "Xp5YAcWB9HBeJ5NBg", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tno Class.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "4aGvdbRPZaZRzBsDh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:21:09"} {"_id": "buayn6tBX88wFJy9C", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class, s: Student, g: Group | some t: Teacher | (c->t not in Teaches) implies c->s->g not in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MigBfJypprkgM2LvJ", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Person}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-30 22:17:47"} {"_id": "rxpjszuJZpmw5A7Tb", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tsome Student.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WaD498bvtaN8wPoYv", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-4 19:56:14"} {"_id": "phcTq4w4pNL9zkH3h", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mDdJ2uccBifPY5HZA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-2 23:54:17"} {"_id": "mRcSrYxAB8pB5JEgy", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some g:Group,t:Teacher | c->t->g in Groups implies t->c in Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "56YzPxxRGD6HX3rot", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 18:47:26"} {"_id": "yQFj3Ri3jeW4GFZkG", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ksf7ERQuYZ3qogX3p", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:23:22"} {"_id": "DrzPHKqEiHcaf4wTB", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | (all g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "W4zSyzAt3euAM9jxw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 12:54:07"} {"_id": "AZ4ZkTJBxNRn8eApn", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall t:Teacher | some g:Group,c->Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dBB3fnAGvi5xgAYxG", "msg": "There are 3 possible tokens that can appear here:\n, : =", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:47:30"} {"_id": "7Pb965F2NbrCHrmzJ", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | some t:Teacher | p-> in 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\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MDrFf5hf4BNEzwaoP", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-28 21:49:15"} {"_id": "AzGvrvo2mJqfykWWi", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t:Teacher | lone t.Teaches\n ~(Teaches<:Teaches).(Teaches<:Teaches) in iden\n\n}\n\n/* No class 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mfqz85S6qzcQzfuG8", "msg": "This must be a unary set, but instead it has the following possible type(s):\n{this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:50:04"} {"_id": "FNvRkbTBBXJcGRf69", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bA4uCN2uwn9dz3eGS", "original": "YH3ANm7Y5Qe5dSYem", "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": "Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "Student:Person"}, {"parent": "Person", "type": "Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 177.60000000000002, "y": 238.79999999999998}, "Class1": {"x": 355.2, "y": 238.79999999999998}, "Class2": {"x": 532.8, "y": 238.79999999999998}, "Group0": {"x": 222, "y": 318.4}, "Group1": {"x": 444, "y": 318.4}, "Group2": {"x": 666, "y": 318.4}, "Person0": {"x": 710.4, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}]}}, "time": "2019-9-26 12:53:10"} {"_id": "sGYPtKGs66jqdeg7E", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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 t : Teacher | t -> c not in Teaches implies (all p : Person, g : Group | c -> p -> g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ChLxCkJA2q3bCoS2Y", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:02:09"} {"_id": "a3CXmRkv7WndowDd3", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\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\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Xjue3AnKYT9Fjti8t", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:42:34"} {"_id": "xxKPE3ZoysF8WHd9P", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mG2EkAigxbJuYve8y", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-1 17:26:38"} {"_id": "bwdgBP6jShy9spSQD", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n \tsome Teacher 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4AQnHxnw39gLmGsuM", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 21:34:23"} {"_id": "ssCTn3GeE3NrQgzpE", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class,g:Group |some t:Teacher | some c.Groups implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "rNdgw9c7gLXZtWeBx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 11:01:15"} {"_id": "qeEk6GQQPwwyRMhSN", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-29 16:24:42"} {"_id": "CQrsz5syJh2p6kgW9", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class | some t: Teacher , p: Person , g: Group| (c->p->g in Groups) implies (t->c in Teaches)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | some g: Group, c: Class | (c->t->g in Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p:Person, p2: Person | p->p2 in Tutors implies (p in Teacher and p2 in Student)\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tWDdiNMzhKu9QxzSb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-30 22:41:44"} {"_id": "HT8LsRonwKd6DKDyb", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class , t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c,d:Class | t->c in Teaches and t->d in Teaches implies c=d\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 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\tall t: Teacher, c: Class | t->c in Teaches implies some s:Student, g:Group | c->s->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JCtifQrucnTzhAXY9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:46:42"} {"_id": "oC24byGpQAg4GSCYL", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, g : Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BWNqpXuqyDCBWnXrM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 20:52:21"} {"_id": "zfwR6EJHxMNS22EDh", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group,p:Person |some t:Teacher| c->p->g in Groups implies c->t->g in 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\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "KRoDYpN7nvPGvxz2c", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:04:06"} {"_id": "GhF8S6setsYudFreY", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, g : Group | c->t->g in Groups and t->c in Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | (some c : Class, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DvAhe4ySPTPg6dJ9K", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 21:05:04"} {"_id": "26zQNscBsyC5uxWLb", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "btvCsSE9bqugN757f", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 10:14:03"} {"_id": "YTEh9gjm3yT2QnN2C", "cmd_i": 12, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, s:Student|some t:Teacher, g:Group | t->c in Teaches implies c->s->g in Groups\n}\n\n\npred inv12 {\n\tall t:Teacher , s:Student | some g:Group ,c:Class| t->c in Teaches and c->s->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p:Person | p in Tutors implies p in Teacher \n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "c2eAXTubo9cZ7A42c", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:33:22"} {"_id": "Qgnyv84CWPaEKxtWo", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RXfC8jaitnT4wyA3R", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 11:23:00"} {"_id": "EYWLis3qEhZFExHta", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \tall s:Student | s not in Person.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "EYpjtjGiTQQigj6C9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:55:55"} {"_id": "eG7w6N8zcEpJtJY9E", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\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\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student \n}\n\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student, c:Class, g:Group, t:Teacher | (t->s in Tutors and c->s->g in Groups) implies t->c in Teaches\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fXdkwbYgMBhBApWd2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 00:14:21"} {"_id": "MDrFf5hf4BNEzwaoP", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | some t:Teachers | p-> in 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\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "F472bnac5eRoAw6hd", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-28 21:49:05"} {"_id": "bP5jyDN3vNJvdPns8", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YHagd289iHEZnYr2K", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 11:37:50"} {"_id": "TtL8DFcAwT2h5Jgwn", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p not in Student and p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "39n9JDvAeJDp4HWke", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-2 23:45:13"} {"_id": "vnREk65RpDYtuuZ8K", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2Nnx2KDzAFQMx5qPr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:08:50"} {"_id": "kKc5cEF4LeEhsQPjr", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,g:Group,t:Teacher,p:Person | c->p->g in Groups implies t->c in Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RexNL9Gy4fakCsLj8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 18:49:28"} {"_id": "wD2QahEYfc7Avqzkw", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class , t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c,d:Class | t->c in Teaches and t->d in Teaches implies c=d\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 s : Student, c: Class | some g : Group | s->c->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gZ3obLAxf3dq892Kb", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person->this/Class->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:37:05"} {"_id": "ozyZLhwPj5DcHcBLn", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches implies some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Person | some c : Class, g : Group | c->p->g in Groups implies some t : Teacher | t->c in Teaches and t->p in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ppBRkswMBE6RbS6uY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:31:56"} {"_id": "qQuqYJtNGJA6okCeP", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1,c2:Class,t:Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c:Class, g:Group |some t:Teacher | t->c in Teaches implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AhiEkMK73ffJPt25s", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:11:32"} {"_id": "afDfErzkwKxJcTfHL", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p: Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some c:Class, some t:Teacher | t->c\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "38fCFXa6LGrQRkrDB", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:28:08"} {"_id": "L4tFgCkZaSrjqsNFK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hn83iDziKK864Wrpo", "original": "YH3ANm7Y5Qe5dSYem", "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": "Int"}], "metaSubsetSigs": []}, "nodePositions": {"Class0": {"x": 666, "y": 132.66666666666666}, "Class1": {"x": 444, "y": 132.66666666666666}, "Class2": {"x": 177.60000000000002, "y": 265.3333333333333}, "Group0": {"x": 355.2, "y": 265.3333333333333}, "Group1": {"x": 532.8, "y": 265.3333333333333}, "Group2": {"x": 710.4, "y": 265.3333333333333}, "Person": {"x": 222, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}]}}, "time": "2019-10-2 10:50:55"} {"_id": "2My2br5gMtE7k6wm3", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c.Teacher 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RsgpmMFqzrFwKNtbw", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Teacher (type = {this/Person})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 23:58:48"} {"_id": "sodz8C2tCHjHMwJEa", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class,g:Group | some t:Teacher |(t->s in Tutors and c->s->g in Groups) implies t->c in Teaches \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XhPSFjENesEQXEcHX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:06:51"} {"_id": "CQeLs2vR3PJv947sY", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 all c : Class | all s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all t : Teacher | (t -> c not in Teaches) implies (all p : Person, g : Group | c -> p -> g not in Groups) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oPRprchuW2YipABN2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:12:57"} {"_id": "zzpC7JS38Gg26ntCd", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class| some t:Teacher | some ~Groups.c implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "vGAMyoTzsuak7GdHq", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 12:03:10"} {"_id": "pz3jn94TpGMjMf2Rk", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jdd6uEX7XnXhAZqYN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:28:40"} {"_id": "vjZeMtw9gAy4aB6sR", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\t\n\n\n\tall c:Class| some p:Person | some Groups.p \n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "ETWeK6u56RkYE3v7v", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:18:06"} {"_id": "saG246LfCyiobfRvt", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jmtzzuGtQFdKbgYng", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 11:31:14"} {"_id": "H7b9xkpFEbyt6kYJE", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher in Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tTeacher.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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YKDK37XDEL4uZoiQM", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:39:50"} {"_id": "FWpNrQBSXXMrhfmYR", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n all x, y, z : Person | x->y in Tutors and y->z in Tutors and z->x in Tutors implies x in Teacher\n}", "derivationOf": "xjMweD8xy5gpxf8Q4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 19:33:38"} {"_id": "i67xFoQdBDhejb9ax", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall s:Student,t:Teacher | s!=t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p in Student or p in Teacher\n}\n\n/* There 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\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n all t1:Teacher,t2:Teacher,c:Class | (t1->c in Teacher and t2->c in Teacher) implies t1=t2\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NYGPtw5FQsGrEeQ4k", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:40:36"} {"_id": "rwqCnmGpZ6KyXa2DR", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Mr8aDTGDqLNqf78A6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 10:19:20"} {"_id": "4kZTi5WoLmeBSm3st", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall p:Person, c:Class | (some t:Teacher, g:Group | c->p->g in Groups implies t->c in Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student \n}\n\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wCeRiNNdRkY2tuaFt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 00:05:28"} {"_id": "qsZ5wEkMgiKvzshAZ", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student,t:Teacher,g:Groups | c->s->g in Groups\n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "Yu6CFMN7coGhgWZee", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person->this/Class->this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 13:00:05"} {"_id": "EkvDE2tboajf8MZji", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall p:Person | p in Person\n \n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KtFNRaz9gG4b9XtTT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 10:43:21"} {"_id": "6qKcP3enB55nguomH", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some t : Teacher, c : Class | t->s in Tutors implies t->c in Teaches\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Kr4wZeZzLs8bzZC95", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:27:24"} {"_id": "CPXKRRc8G4BrbsyWa", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall x : Class | some y : Teacher | y->x in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall x : Teacher, y,z : Class | (x->y in Teaches and x->z in Teaches) implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall x : Class, y,z : Teacher | (y->x in Teaches and z->x in Teaches) implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall x : Class , y : Student | y in Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NC8cnbR86Jq9zYjgr", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:41:42"} {"_id": "gmJYDuwBcQ37eMfsf", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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, c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kKfEfx6S9JnY5cCfn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:32:37"} {"_id": "5GEGzspiQJmaXZhyL", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class |some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\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\tall c:Class | some t:Teacher | t->c in Teaches implies some g:Group | some c.Groups.g\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oH7J3PLxGFaKmvYLH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 11:41:45"} {"_id": "ZwvFWxzL9qtQi9HKr", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class|some t:Teacher | t->c in Teaches and one s.(c.Groups) and one t.(c.Groups) implies t in s.~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "LPWykSzMrK4PdA5zN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:37:27"} {"_id": "fiW2c7HqhALgogZwN", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class | some Person.(c.Groups) implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aprau2HrFYQ3XEtBY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 12:18:21"} {"_id": "DJPw3q5BqgGhCXw4v", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "hTSL9Ry6Q4CactvGW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 21:12:50"} {"_id": "mgkxLrX6zFTYYT2LR", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t : Teacher | 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jGd3Lue6mEN8zAcjP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-3 00:06:45"} {"_id": "zf7nQN8HGKSAcS4rh", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DiwKu5sG7KuuRjjs5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 11:30:49"} {"_id": "BDXewisBMwdzpSAGm", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MMLgDzyHP8AGJDg7k", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 14:44:00"} {"_id": "J3tEZducPMzFN6SSv", "cmd_i": 4, "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some g:Group | t->g in Group\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YL8P6f5v7FadrKBKp", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 10:38:12"} {"_id": "sdDaLnSmbomqZnL3R", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher & c.~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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "c4mpKsDKWeFRcQPwi", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 09:39:12"} {"_id": "2hEmhW3jd8qkL98Mt", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n \t\n \tall c:Class | some t:Teacher | some c.Groups.Group implies c in t.Teaches \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "y46SQDaW5mP2Kid87", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:30:47"} {"_id": "BC4oL3KRCZTdcp2zZ", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RbcFNYtGPRncPfkNZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 17:37:30"} {"_id": "Xg4yEdo4nZ2ms9tRo", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\tall t:Teacher | (some g:Group | t->g in Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LMKp9W3XTLskank59", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 11:59:38"} {"_id": "jigYmbq5RKpAMCYbz", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class, g: Group, s: Student | some t: Teacher | c->s->g in Groups implies t->c in Teaches and t != s \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cdL7vgWnzxCYXdNJP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-30 22:26:02"} {"_id": "kim8JKBhDBFsgpRPH", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4Deevq37auTuNM7PJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 12:11:48"} {"_id": "kmo4Dmwm3M2Fr9oTE", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Class.Teacher\n}\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fbFNkFbc5NQ4Nnih6", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:29:52"} {"_id": "Haf7YbQQvnLf7BiEt", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all P : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "msg": "The name \"p\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:06:45"} {"_id": "g95kaNbBvMAe8pNAb", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n all 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PnCX5FHXhgQimt9Ki", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:10:41"} {"_id": "itgwNDuKZBADwiJRR", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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, t : Teacher | (t -> c not in Teaches) implies (all p : Person, g : Group | c -> p -> g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sFt3hnoBJ22ydADHn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:04:49"} {"_id": "QHF8E3fRSYZAxpSWG", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6e755ecbFMjapw4C4", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 13:11:05"} {"_id": "sAXjRf9FDXBfg7GC5", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class | t->c\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DY6NtGsjbrKaNka4t", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 11:25:00"} {"_id": "cGfJQv7WSmY3MqHPJ", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1,c2:Class,t:Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c:Class|some t:Teacher, g:Group | t->c in Teaches implies c->t->g in Groups\n \t\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t:Teacher, g:Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Yk3Fo2YyvBCF8b3ok", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 15:26:34"} {"_id": "9zrkJS9rfeoeDrQNq", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \tno Class.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YyZDwdFNkp3F8ttvp", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-4 18:11:42"} {"_id": "muoiJ2ugTQBooPh4M", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class | some s: Student, t: Teacher, g: Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mCv8vTvWYP4w5mjtJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-30 22:21:46"} {"_id": "DQtLyEY8C7nkGGEjM", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some t : Teacher, c : Class | t->c in Teaches implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pY5Xmh23av2PJcQgR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:31:10"} {"_id": "aQD9Po7HQzasfNWq8", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\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\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n \t\n}", "derivationOf": "cGJP9Ks4QQv2m5FD3", "original": "YH3ANm7Y5Qe5dSYem", "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": 222, "y": 199}, "Class1": {"x": 444, "y": 199}, "Class2": {"x": 666, "y": 199}, "Group0": {"x": 222, "y": 298.5}, "Group1": {"x": 444, "y": 298.5}, "Group2": {"x": 666, "y": 298.5}, "Person": {"x": 444, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "this/Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "this/Teacher:Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "this/Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "inherit", "type": "this/Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "this/Student:Person", "visibility": false}]}}, "time": "2019-11-4 20:01:56"} {"_id": "2brcnXyWZLTzWSzvy", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NqKMF5rFc5gomGPrf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 11:14:55"} {"_id": "jeC28X2N8M3YeEaL8", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c:Class, t:Teacher, g:Group | t->c in Teaches implies c->t->g in Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cPKhSq4CLjo8hbmsB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 17:53:59"} {"_id": "hEMXJ7KYKej6fRpFK", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\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 | some 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cNR2XqBYuwdydTFFj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-10 14:54:39"} {"_id": "XHsgSFZprraFv2AAn", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \t\n \n \t\n \tall t:Teacher | some c:Class,g:Group | c->t->g in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "MNikLWxx9ZvNeZKLC", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-8 10:28:03"} {"_id": "rgxhhEeNpQBrkN6wE", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2brcnXyWZLTzWSzvy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 11:15:24"} {"_id": "a2kocdTbgNebBcnAj", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 \t\n \tall t:Teacher | lone t.Teaches\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FDin2oHtZnau2ejbf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:32:28"} {"_id": "eFu8ezQWymCXiGz9R", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher, some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QpYRzDCgD8B9CwSjg", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:15:32"} {"_id": "3SxYJRiH8stfuntkE", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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 t : Person, c : Class | (some g : Group, s : Person | c -> s -> g in Groups) implies t -> c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Person, c : Class, t : Person, g : Group | (c -> s -> g in Groups) and t -> c in Teaches implies t -> s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n some p1, p2, p3 : Person | p1 -> p2 in Tutors and p2 -> p3 in Tutors and p1 in Teacher\n \n}", "derivationOf": "j5FJExfKL6t5eHZrQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:30:12"} {"_id": "oSbkrWznkEbCySy8H", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p: Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9HCrucHXNcp8MJFHH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:15:17"} {"_id": "RdCA9xXXBKtJN5X6x", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher | some y : Class, z : Group, v : Person | x->y in Teaches and y->v->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n\npred inv14 {\n all x : Person, y : Class, v : Teacher | (some z : Group | y->x->z in Groups) and v->y in Teaches implies v->x in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "q8WvsHLEiucRiiXDY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:51:21"} {"_id": "92oM78Hyuh5v5rbmv", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x: Class, y : Student | some z : Group | x->y->z 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KJ2bmS3cYm7Y7YAaj", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-27 12:24:50"} {"_id": "Y3hMMEnsudcWW4pHe", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies 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\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "xX3WohjMRqZFhSfuS", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 14:45:39"} {"_id": "bs2ioB2rAijscemhc", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \tno Class.~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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vzAr2iWYX3CidkRnu", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-4 18:12:20"} {"_id": "wzPv6srx2MwvKhKZq", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c : Class | some t : Teacher, g : Group | c->t in Teaches implies c->t->g in Groups\n}\n\n \n\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3xSNtJxcwSWvCYi4Y", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Person}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-3 00:16:44"} {"_id": "7xmE2GA6XQSHpApm2", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 \t\n \tall t:Teacher | lone t.Teaches and lone t.Groups\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TGhkJL7WgujGLPYya", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:28:41"} {"_id": "mCv8vTvWYP4w5mjtJ", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class, s: Student | some t: Teacher, g: Groups | (c->t not in Teaches) implies c->s->g not in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cXnDbnBvokmf4CLiH", "msg": "!in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person->this/Class->this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-30 22:18:47"} {"_id": "TLsdAko7htHjfAFn2", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, t:Teacher , s:Student, g:Group| t->c in Teaches implies c->s->g in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KCcSHyPszhwaxACv8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:22:56"} {"_id": "WCuq85uzP5vmCkWFC", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1,c2:Class,t:Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Nzt9MA7Cd5SXQ2hHK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 15:07:06"} {"_id": "Qg8Rz5dweXnPqySqM", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome c:Class | hasTeacher[c] \n}\npred hasTeacher[c:Class] {\n\tall g:Group | group_has_teacher[g]\n}\npred group_has_teacher[g:Group] {\n\tsome p:Person | p in Teacher and p in g\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "R2GPttJHgqkqDkNbC", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:34:19"} {"_id": "W6uKRoZrMHFHEGMWM", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 not in Person\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8oyuWmFkfqfdijn9W", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 14:56:08"} {"_id": "2pH86E6aAenpNX3ap", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Person,c:Class,g:Group | p in Teacher implies c->p->g 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "W9z4s9CCQRx2GSdPN", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:26:22"} {"_id": "db5KTK9dEiK5KhxPv", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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 (Teacher <: Teaches).~(Teacher <: 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gmAKk2TPHssWK274d", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-10 18:28:47"} {"_id": "jGd3Lue6mEN8zAcjP", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Cyrri8e2wwRchwZPh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-3 00:03:23"} {"_id": "3dbotfZWTzrFgjPd3", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "G3jepF6mgeku6ihDt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:39:04"} {"_id": "QSDmQNaYgNodpzo7w", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "A2xqCdq2PLnCHGmiA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 10:17:51"} {"_id": "vWe337Nc5sQQA59vT", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tyrfpx3Qdi9gj8KD5", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 10:28:01"} {"_id": "D9kin9dihDunrvQFT", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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 all c:Class,g:Group | some p:Person,t:Teacher | c->p->g in Groups implies 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\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "8ca2p9HKZqMxpBYg7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:50:51"} {"_id": "gpbXopzmssijxmw3o", "cmd_i": 12, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\nall s,t in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vQcK3r2SSeSsNJMEm", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 12:55:22"} {"_id": "A7JPWeLXSS8ZohkHD", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SPoNbGoXJukjRhy7T", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 17:34:40"} {"_id": "cgJWYLDGjbgfLs5Mw", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome p:Teacher,c:Class | p->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "m65eEBySYNPaAnj5N", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:36:58"} {"_id": "8Hpq45iZG4HiteCfv", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NT32Wwjiqjgg7q4nH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:27:25"} {"_id": "GYGTbxQtLcifnpYp5", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class | some Person.(c.Groups) implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "qkWtu5Tj9jo7PkgWR", "original": "YH3ANm7Y5Qe5dSYem", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}]}, "nodePositions": {"Class0": {"x": 666, "y": 132.66666666666666}, "Class1": {"x": 222, "y": 265.3333333333333}, "Class2": {"x": 444, "y": 265.3333333333333}, "Group": {"x": 666, "y": 265.3333333333333}, "Person0": {"x": 444, "y": 132.66666666666666}, "Person1": {"x": 222, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "seq/Int"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "this/Student:Person"}, {"color": "inherit", "type": "seq/Int"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "seq/Int"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}, {"type": "this/Student:Person", "visibility": false}]}}, "time": "2019-12-2 12:19:01"} {"_id": "btvCsSE9bqugN757f", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student | some t:Teacher | t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "XCFbbiWwhbcsC5fay", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 10:13:21"} {"_id": "vAsZfLERGQun5HHPn", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | some c.Groups implies c->t->g in Groups and t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "zE9piYTrtvzaqQagB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-11 11:19:09"} {"_id": "M63qsmLmQHbKEiatB", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n \t\n \tall c:Class | some t:Teacher | some c.Groups implies c in t.Teaches \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "tKMiP59Ntcghs9fvr", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:27:29"} {"_id": "vrPoBihFNYbX3qk36", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PcyGCaN3PGKNDeo6B", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 18:20:10"} {"_id": "aprau2HrFYQ3XEtBY", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class | some Person.(c.Groups) implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LjZHXZWjr4yJ3ZPgH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 12:17:37"} {"_id": "wFQgDgNrCoBQurS3P", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nRJgjz8b865JM9puk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-28 16:41:45"} {"_id": "xbgAGxLRBAwgbtjYp", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | ((all g : Group | c->s->g in Groups) and t->c in Teaches) implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DrzPHKqEiHcaf4wTB", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 12:55:08"} {"_id": "KrwXNJ8QMz9adeBrE", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "jq5P5SB9o5iQ7eY9h", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:35:08"} {"_id": "xRk8R7YXZbnyt2jje", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \n \t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tall c:Class, t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n \t^Tutors in Teacher\n}", "derivationOf": "CsX2ppRki99ZCrgRv", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Person}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-2 15:51:43"} {"_id": "XHcpCYLGt5DoKxBLJ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n some c : Class, s : Student, g : Group | c->s->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "u2byeCgqE2cDoZiNc", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:41:35"} {"_id": "mLjQuB9ciPa9CZTzm", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class,g:Group |some t:Teacher | some c.Groups implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NpcPCRWJTF5WkzQ6T", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 11:00:34"} {"_id": "cgngrbjKGMhgtWjKp", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome p:Teacher,c:Group | p->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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "P32XZRDjF8ffQNg8j", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:37:41"} {"_id": "tsg5ykwamcAWL8of7", "cmd_i": 4, "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Classes | some t : Teacher | p->c 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PyZiYzken5kHLP9CX", "msg": "The name \"Classes\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 10:46:53"} {"_id": "LcjYY9pLzqJAnCcwb", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \n \t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iaTmQQ7XkxbXQWfF2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-2 15:45:50"} {"_id": "2W2KLPHebxZKAeTMo", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YopcSWQwJ9Qb74buE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 20:59:01"} {"_id": "7fAwX4G2YRnxA7EiZ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\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\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uf8yTWBKXgAnxHYWk", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-4 19:59:36"} {"_id": "cFaqh3riLKt4XjMKX", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\n \t\n \tall c:Class,t:Teacher | lone c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n \t\n}", "derivationOf": "9DTwRMA8yEk6ZPPZa", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-4 20:24:48"} {"_id": "pojrP9Rww2tbhZTNF", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WnX53yYfqqqt82hzH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 21:17:31"} {"_id": "j8hJ8DZg6EEBGPfKb", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SBDZrRqRLi3kT6qR4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-10 14:56:21"} {"_id": "NweqmdZBkRAiqhi2d", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FNvRkbTBBXJcGRf69", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 12:59:38"} {"_id": "CcHQjRCP4LnAivx88", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 12:12:37"} {"_id": "4oY6FFZt2Z6ayCca2", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class,g:Group |some t:Teacher | some c.Groups implies c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2XQA7sCc3qx4P67h2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 11:00:25"} {"_id": "SfegWAv9ix7kyMaa7", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, x, y : Teacher | y->c in Teaches and x->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in Groups\n\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 all x : Teacher | some y : Class, z : Group, v : Person | x->y in Teaches and y->v->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kPChmnjQPXSjRog7A", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 17:41:50"} {"_id": "MenaKJTmorRSrnuhp", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some q,r : Person | (p in Teacher or q in Teacher or r in Teacher) and (q->p in Tutors or r->p in Tutors or r->q in Tutors)\n}", "derivationOf": "zPePfRrk8TGd3zSNX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 22:05:32"} {"_id": "XHpffQ2WmuzhgzuD2", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3mHcZPPZZr3GSt2yN", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 11:29:37"} {"_id": "qhKCoobsmm79Dw3sn", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "i9FCMNeHaDFZEbxKK", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 14:39:50"} {"_id": "CkRz3FNWLC4Do5pqE", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MbAYmTyRwjgGixyz6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 11:27:49"} {"_id": "m65eEBySYNPaAnj5N", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Gun9gr4gDnz6noeXG", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:34:15"} {"_id": "LDwMo2jFqH62cpK3A", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CYhj6BF2vwG8Wrw5g", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 09:54:46"} {"_id": "GHjCvgtC5dS4fsWH4", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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. */\n\npred inv11 {\n \n all g:Group, c:Class | some p:Person | c->p->g in Groups implies p in Teacher\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ev3EC9Eq7yPTmWjQy", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 14:30:46"} {"_id": "LYfwwPGcfkAzj6TRk", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "pmPSmvLFryXbiTivt", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 10:18:17"} {"_id": "f2kmJvJ5atJdwYAct", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,t:Teacher,g:Group | one c.Groups.t.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "qj4ZXGZvzxptumH6d", "msg": "This cannot be a legal relational join where\nleft hand side is c . (this/Class <: Groups) . t (type = {none})\nright hand side is g (type = {this/Group})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 11:23:03"} {"_id": "JajfmcfpADsRJkvE2", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Teaches.Class | one Teacher \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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "k5kLHnCELBNyMxpk9", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 18:52:34"} {"_id": "B4gPZbQWmeGTJABPY", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WMoQGHQRCm4K2dwc6", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:42:51"} {"_id": "tNZBCDYjos9j4WtRi", "cmd_i": 12, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Pdtp9RhdLe6RGdFy4", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 12:35:01"} {"_id": "gGdvA3BdJ5NGHZ3ef", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KphzxfvRFyeJ8b7T8", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 09:22:11"} {"_id": "YETcANih2sX46Fvvm", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There 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\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6BLMHnMPtdNkjufdQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:19:08"} {"_id": "JjFx8LMTv7YExYnHi", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n \tall p : Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | (some c : Class | t->c in Teaches)\n}\n\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | (some t : Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c : Class | has_groups[c] implies (some t : Teacher | t->c in Teaches)\n}\n\npred has_groups[c : Class] {\n \tsome s : Student, g : Group | c->s->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3RmHaZBpvBte2Lmwz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:43:46"} {"_id": "7f6gF9ygn2GXegvjh", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teachs\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Ej5AGZ9ejuM726EYp", "msg": "The name \"Teachs\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 21:16:03"} {"_id": "eEcet5DrdwLaaNAbp", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "vqjxgmgGrz57i4KMZ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-17 09:44:49"} {"_id": "hLREyRZLkdMf956BC", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome p:Teacher,c:Class | p->c in 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\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class,t:Teacher,s:Student | some g:Group | c->s->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "r7GK3jZwmLTXEGN5o", "original": "YH3ANm7Y5Qe5dSYem", "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": "Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "Student:Person"}]}, "nodePositions": {"Class0": {"x": 222, "y": 199}, "Class1": {"x": 444, "y": 199}, "Class2": {"x": 666, "y": 199}, "Group0": {"x": 444, "y": 298.5}, "Group1": {"x": 666, "y": 298.5}, "Group2": {"x": 222, "y": 298.5}, "Person": {"x": 444, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}]}}, "time": "2019-9-26 10:53:12"} {"_id": "vdQoYHfmwCCWRncHQ", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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 s:Students, c:Class | s.c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "ERBfgaTL2LzxW7nC6", "msg": "The name \"Students\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:49:44"} {"_id": "78AK6xwg9qbwzovfB", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n all x, y, z : Person | x->y in Tutors and y->z Tutors implies z in Teacher\n}", "derivationOf": "CLffpZLEj3d9BdKdf", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 19:12:09"} {"_id": "dt7uiCiZpCjpMJkgc", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by 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/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-14 10:54:25"} {"_id": "HfoDtpFNkvWrDy4Nk", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t.teahes 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YyJa2kBDCA4JLhZLq", "msg": "The name \"teahes\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 23:57:02"} {"_id": "qBdNTAxy7g4pZfSjD", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some c:Class | c in t.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in c.~Teaches\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\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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | s in c.Groups.Group implies some t:Teacher | t->c in Teaches \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "kFM5ccHPN7d6334Mf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-12-2 11:43:51"} {"_id": "f4uiit3xiwKNESoMq", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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\tno Teacher\n}\t\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WT58vQo88GwPpgKB4", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 12:12:55"} {"_id": "XuHxbGR9vpq77JZ44", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\tall c:Class|some t:Teacher | some Person.(c.Groups) implies c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "a2Z9n6QJPfnCGXPZW", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 15:31:47"} {"_id": "DxqMfpaxj3bnwDp2X", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "z639op94MrSLAaMMb", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 17:29:31"} {"_id": "tHMzxWBkBiLDKM4Hf", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t\n \t\n \t\n \t.Teaches in Class\n \t\n \t\n \tall c:Class,t:Teacher | t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n \t\n}", "derivationOf": "gBnhXd93RPNGxSLDp", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-4 20:26:07"} {"_id": "FiAoFM9qSg3RCCfsW", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "i4ZYANN5vwGTAXcfM", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-13 16:07:56"} {"_id": "cX5xtRhNRs4xz7NTt", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RXRKjMjBSMZ8qQAcQ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-8 11:20:42"} {"_id": "SAFtys5nw67HQyRF3", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \tall p, q : Person, c : Class | (some g : Group | c->p->g in Groups) and q->c in Teaches implies q->p in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tsome p,q,r : Person | (p->q in Tutors or q->p in Tutors) and (q->r in Tutors or r->q in Tutors) and (p->r in Tutors or r-> in Tutors) implies (p in Teacher or q in Teacher or r in Teacher)\n}", "derivationOf": "fe4nSRywfmWc7rhxZ", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 16:13:45"} {"_id": "mSFtAdnB9zAkwZYWB", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\tall c:Class | no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "o2kBmvCveuK68h2fm", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 11:55:48"} {"_id": "sFt3hnoBJ22ydADHn", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 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, t : Teacher | (t -> c not in Teaches) implies not (some p : Person, g : Group | c -> p -> g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GCaqxTkSrSKNtREcs", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:04:34"} {"_id": "hPLc2F9fKh6PauWJ3", "cmd_c": false, "cmd_i": 0, "cmd_n": "run$1", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\nrun {some Groups}", "derivationOf": "PqcCBYsYhPpFNPpBA", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 13:30:00"} {"_id": "gPyps9AfhfNimYKBK", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PAuTGLW2quxcGkegJ", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-1 09:52:55"} {"_id": "PgC4ZjYLa5kobRRe9", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\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 s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tsome Class.Groups implies some 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FAATdNueew6Kb3zbL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 12:04:37"} {"_id": "PKwooxLeQyjZYeEas", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall s:Student,t:Teacher | s!=t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p in Student or p in Teacher\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cAua8P78P4SF5Ejy7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:29:33"} {"_id": "wu6Fi3uvX8MjZLrZQ", "cmd_i": 14, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \tall p, q : Person, c : Class | (some g : Group | c->p->g in Groups) and q->c in Teaches implies q->p in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tsome p,q,r : Person | (p->q in Tutors or q->p in Tutors) and (q->r in Tutors or r->q in Tutors) and (p->r in Tutors or r-> in Tutors) implies (p in Teacher or q in Teacher or r in Teacher) \n}", "derivationOf": "SAFtys5nw67HQyRF3", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 16:13:50"} {"_id": "iqHbZjv4Lk4aGxmoD", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class, g: Group, s: Student | some t: Teacher | c->s->g in Groups implies (t->c in Teaches and t != s)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | some g: Group, c: Class | t->c in Teaches implies (c->t->g in Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DGXSMJkbktqYQkkbT", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-30 22:30:02"} {"_id": "iwx8RMvhCTsioE9Qw", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 all c:Class,g:Group|some t:Teacher | t in c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,g:Group |some t:Teacher | t in c.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class|some t:Teacher | t->c in Teaches and c.Groups \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "xrozcjtiu5MfJiEAJ", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 11:33:41"} {"_id": "KRoDYpN7nvPGvxz2c", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\tall c:Class,g:Group,p:Person | c->p->g in Groups implies c->t->g in 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\tPerson.^~Tutors in Teacher and Person.^Tutors in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "4a5QyxtpQLsT6yHew", "msg": "The name \"t\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-11-11 11:03:56"} {"_id": "hziqLZR4viFsaWtgF", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 { \n\tall p : Person | some c : Class, g : Group | c->p->g in Groups implies p in Student and some t : Teacher | t->p in Tutors and t->c in Teaches\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CF9XCmFNQdYqXWcNf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:45:03"} {"_id": "BnkSXceT3ezk7TXac", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pukA5N5DX8pRD8nD9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-13 16:13:08"} {"_id": "tF8g56RN9eF2xPAzH", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yXJFk9596Sq2zKSi7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-21 16:44:24"} {"_id": "TQhrJWa9XdejafxEF", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t all c : Class| some t : Teacher | t->c in Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1,t2 : Teacher, c : Class | t1->c in Teaches and t2->c in Teaches implies t1=t2 not 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6g5twzCN7C3eq6JLa", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-9 00:21:08"} {"_id": "uQCgDdJZh8z289BsT", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n all x, y, z : Person | x->y in Tutors and y->z in Tutors and z->x in Tutors and x != y and x != z and y != z implies x in Teacher\n}", "derivationOf": "FWpNrQBSXXMrhfmYR", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 19:34:16"} {"_id": "4sPprs8NHZGtKqyC3", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tTeacher 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nisvvnhsnnsNK2tj4", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-3 10:15:24"} {"_id": "xFnpyKxDL8EXXbDQA", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 is 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:26:09"} {"_id": "WxAurvwC9Xgrs3qSJ", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Person,c:Class | p in Teacher implies p->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aqhGcbJ6Yn6RrvR3W", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:28:02"} {"_id": "ACDKwTKmknRPKLmZ3", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Teacher 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gBJL9H4M7vzojrMz4", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 17:29:27"} {"_id": "WF2ivKgS6akee5Lz4", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p not in Student or p not in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TtL8DFcAwT2h5Jgwn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-2 23:47:07"} {"_id": "bau2GLtrpQ4bvaC3k", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rRF5bR267Pb2qfynw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-10 16:40:52"} {"_id": "RS4NnSzRTwopgjtmM", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\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\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tsg5ykwamcAWL8of7", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 10:49:24"} {"_id": "WF8Cf8wZCveAzDYoa", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kZkTkwQoYcRNNuvfn", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 12:51:54"} {"_id": "jFWR7PCyE87RuSG3Q", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class, g : Group | c->s implies some t : Teacher | t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "e7BjE52mPxp9NdwC8", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 21:12:26"} {"_id": "vBDWJoprgwtKAXf73", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every 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\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\t\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "oFHuDNrTqzQPGtyk6", "original": "YH3ANm7Y5Qe5dSYem", "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": 798.65625, "y": 99.5}, "Class1": {"x": 299.49609375, "y": 199}, "Class2": {"x": 598.9921875, "y": 199}, "Group0": {"x": 598.9921875, "y": 298.5}, "Group1": {"x": 898.48828125, "y": 298.5}, "Group2": {"x": 299.49609375, "y": 298.5}, "Person": {"x": 399.328125, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "this/Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}, {"color": "inherit", "type": "this/Teacher:Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "this/Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "inherit", "type": "this/Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "this/Student:Person", "visibility": false}]}}, "time": "2019-10-3 10:57:32"} {"_id": "ZWDFaKM5w7JLmcDAM", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p not in Student or p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some p : Person, c : Class | p in Teacher and p -> c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t -> c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1, c2 : Class | t -> c1 in Teaches and t -> c2 in Teaches implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all 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 all c : Class | all s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all t : Teacher | (t -> c not in Teaches) implies (all p : Person, g : Group | c -> p -> g not in Groups) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, p : Person, g : Group | t -> c in Teaches and c -> p -> g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1, p2 : Person | p1 -> p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher, g : Group | (c -> s -> g in Groups) and (t -> c in Teaches) implies t -> s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8C5ENzT2F5eN5iyRa", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:19:08"} {"_id": "QE8jktFjDSTrNqDHf", "cmd_i": 11, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some p : Person, g : group | t->p->g in Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "msg": "The name \"group\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 11:10:13"} {"_id": "9gw8ysmpn5YQnWwZ9", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c:Class, t:Teacher, g:Group | t->c not in Teaches implies c->t->g not in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pRtyhQGLJP2F4Jb9q", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 17:48:33"} {"_id": "L5YdJcYkAEsE93fLx", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some q,r : Person, t : Teacher | t->p in Tutors or (q->p in Tutors and t->q in Tutors) or (t->r in Tutors and r->q in Tutors and q->p in Tutors)\n}", "derivationOf": "e5WxmNSRC5RhtErGY", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-3 07:09:12"} {"_id": "QDdZ7AdCBKdxaB44n", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher | some y : Class, z : Group, v : Person | x->y in Teaches and y->v->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n\npred inv14 {\n all x : Person, y : Class | (some z : Group | y->x->z in Groups) and (all u : Teacher | u->y in Teaches) implies u->x in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7oMTSShGxR5jj4Tno", "msg": "The name \"u\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 15:43:16"} {"_id": "oDpDBHjCDCk65gR6d", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all x : Person | x in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x : Person | x in Student implies x not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x in Student or x in Teacher\n}\n\n\npred inv5 {\n some x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all x : Teacher | some y : Class | x->y in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x : Class, y,z : Teacher | y->x in Teaches and z->x in Teaches implies y=z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x : Class, y : Student | some z : Group | x->y->z in 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 all x : Teacher | some y : Class, z : Group | y->x->z in Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all x, y : Person | x->y in Tutors implies x in Teacher and y in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class, t : Teacher | (some g : Group | c->s->g in Groups) and t->c in Teaches implies t->s in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Tt8KMXkmWafyLmGqP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 15:33:59"} {"_id": "DY6NtGsjbrKaNka4t", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some c : Class, g : Group | c->t->g in Groups implies t->c in Teaches\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QiHdEjnNxoRsjznnx", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:24:02"} {"_id": "nu7shKWWFqK6Bg7ZA", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher,c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5HR8T9qqLDhcshzvF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:38:57"} {"_id": "c4Er9mgXDfjFsYfMK", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class , 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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t Person.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "k5Hisq5eHGCaKZFfh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-1 18:29:43"} {"_id": "hCQEPLchZ29PrCn5Z", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \n \t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tall c:Class, t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9ndKqdnus87i6meLg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-2 15:49:04"} {"_id": "zZSzfsWAQGXMTCmpK", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class, g: Group, s: Student | some t: Teacher | c->s->g in Groups implies (t->c in Teaches and t != s)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jigYmbq5RKpAMCYbz", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-30 22:26:15"} {"_id": "XKmgPZJqu6ZzvAFLC", "cmd_i": 0, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:29:03"} {"_id": "hp5LPva8JB3uPFeub", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\t\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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,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\t\n \tall c:Class | no Person.(c.Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t:Teacher | some g:Group | t in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class,s:Student| some t:Teacher | s in c.Groups.Group and t in c.Groups.Group implies t in s.^(~Tutors)\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "YH3ANm7Y5Qe5dSYem", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 17:11:17"} {"_id": "QrLKNnc4o2PXCM9f2", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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 all x : Class | (some y : Person, z : Group | x->y->z in Groups) implies some v : Teacher | v->x in Teaches\n \n}\n\n\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tvaatMZ2EHhHbkf5f", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-3 00:20:46"} {"_id": "jdd6uEX7XnXhAZqYN", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher, y : Class | x->y in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall x : Teacher, y : Class | x->y 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RBBeH4egjera7gd2u", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:27:48"} {"_id": "a3mJCLLmTfd4YPJv7", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \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\t\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\tall c:Class| some g:Group,t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group,c:Class | t->c in Teaches and c->t->g in Groups\n}\n\n\npred inv13 {\n\tall p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student| some t:Teacher,c:Class,g:Group | t->s in Tutors and c->s->g in Groups and c->t->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tPerson.Tutors.Tutors.Tutors in Teacher\n}", "derivationOf": "aGm2PwpNnjxdJunEP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-17 09:43:59"} {"_id": "WnX53yYfqqqt82hzH", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 in Student\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZSo2QzHB95tnRAaAh", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 21:17:05"} {"_id": "8udq8t54Ez3v3oLoW", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ttMk88Birs3P8BMeH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 09:43:43"} {"_id": "QwKB8QNBrzkvHxCya", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Teacher.Teaches | one Teacher \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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fQz9JGAeemn5mfpRP", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 18:53:58"} {"_id": "cTxpXuesCKePd9okv", "cmd_i": 7, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all y : Class | some x : Teacher | x->y in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all x : Teacher, y,z : Class | x->y in Teaches and x->z in Teaches implies y=z\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, x, y : Teacher | y->c in Teaches and x->c in Teaches implies x=Y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LB4dJQAtLP3SJLtCw", "msg": "The name \"Y\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 17:37:05"} {"_id": "SarcGx6X64nMKe2ND", "cmd_i": 4, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | some t : Teacher | t->c \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rHHtPeGNS6xrRWori", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:37:42"} {"_id": "RrMN96yMYegEhEkT7", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some q,r : Person, t : Teacher | t->p in Tutors or (q->p in Tutors and t->q in Tutors) or (t->r in Tutors and r->q in Tutors and q->p in Tutors)\n}", "derivationOf": "BSh8LR4GBqYmkEo2C", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-3 05:55:20"} {"_id": "hQv3JYNSZyqyhfodG", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class, t:Teacher , s:Student|some g:Group | t->c in Teaches implies c->s->g in 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TLsdAko7htHjfAFn2", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:24:07"} {"_id": "xoPDuyBsh6YNjossN", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \tall p, q : Person, c : Class | (some g : Group | c->p->g in Groups) and q->c in Teaches implies q->p in Tutors \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p,q,r : Person | (p->q in Tutors or q->r in Tutors or q->r in Tutors or r->p in Tutors or p->r in Tutors or r->q in Tutors) implies (p in Teacher or q in Teacher or r in Teacher) \n}", "derivationOf": "2bJwfuhKoMWg2he5F", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-27 16:17:14"} {"_id": "LxPeD7htqrpYhRXEN", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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 no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Person & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Zh2u3TmKyQmbTzrvL", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-8 17:18:27"} {"_id": "JGYpuLCECEABrN9oB", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student 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 in Teacher+Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qNF8PwZN2TTF5p672", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 11:21:50"} {"_id": "8pv9YrfaL84kNemz9", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall p:Person | some p.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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fjFwZAbL4Q53noc7x", "msg": "This cannot be a legal relational join where\nleft hand side is p (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-8 11:29:11"} {"_id": "bytARck63kuZ55T5p", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bPW8AhB5xcCL6zuMC", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:40:52"} {"_id": "77xxu6T6mjzExW2TX", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n \tall p:Person | p not in Teacher \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wFQgDgNrCoBQurS3P", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-28 16:43:30"} {"_id": "Df5wS5EKjPrBcEtjM", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1:Class,c2:Class,t:Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BFnEmFfdBTCdFgZDi", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 15:07:52"} {"_id": "pY5Xmh23av2PJcQgR", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | all x,y : Class | t->x in Teaches and t->y in Teaches implies x=y\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all x,y : Teacher | x->c in Teaches and y->c in Teaches implies x=y\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some p : Person, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some t : Teacher, c : Class, g : Group | t->c in Teaches implies t->s in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YfMa7RffQ6vhedgnw", "msg": "This variable is unused.", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 21:31:01"} {"_id": "qWGCvGX5SyskH4s9r", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher \n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, x, y : Class | t->x in Teaches and t->y in Teaches implies x = y\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, y, z : Teacher | y->c in Teaches and z->c in Teaches implies z = y\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some s : Person, g : Group | c->s->g in Groups) implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher, c : Class | t->c in Teaches implies some p : Person, g : Group | c->p->g in Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "v2hgg5QWphg3FW58w", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:15:21"} {"_id": "QvhsooYb2syudMJip", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors \n}", "derivationOf": "9byWDyHwsfHp3jp3T", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 09:56:00"} {"_id": "o7dNGnPpBubA4gq9h", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\t\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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\t\n\t\n\n\n\t\n \n all c:Class,g:Group| some t:Teacher | some c.Groups.g implies c in t.Teaches\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t:Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student & Student.~Tutors and no Teacher & Teacher.~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \n \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "3i4f37iLFu6zuT9Dg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-8 12:24:04"} {"_id": "MnEnp5dsHRLu7aqjt", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n \tall p:Person | p not in Teacher \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | some c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "i3toD76dnHGYPBDdw", "original": "YH3ANm7Y5Qe5dSYem", "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": "Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "Student:Person"}, {"parent": "Person", "type": "Teacher:Person"}]}, "nodePositions": {"Class": {"x": 470.3937683105469, "y": 265.3333333333333}, "Group": {"x": 627.1916910807291, "y": 132.66666666666666}, "Person": {"x": 313.5958455403646, "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": "Group", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "Teacher:Person", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Student:Person", "showAsArcs": true}, {"relation": "Class", "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": "Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "Student:Person"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#FFDC00", "type": "Teacher:Person"}, {"color": "inherit", "type": "Person"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "Student:Person"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "hexagon", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "rectangle", "type": "Class"}, {"shape": "inherit", "type": "Student:Person"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "Teacher:Person", "visibility": false}, {"type": "Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "Student:Person", "visibility": false}]}}, "time": "2019-9-28 16:58:45"} {"_id": "cXnDbnBvokmf4CLiH", "cmd_i": 10, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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\n/* There are no teachers. */\npred inv2 {\n\tall p: Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | not (p in Teacher and p in 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 classes assigned to teachers. */\npred inv5 {\n \tsome c: Class, t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some c: Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall c1: Class, c2: Class, t: Teacher | (t->c1 in Teaches and t->c2 in Teaches) implies c1 = c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class,s:Student | some g:Group | c->s->g in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c: Class, s: Student | some t: Teacher, g: Groups | (c->t not in Teaches) implies c->s->g not in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "buayn6tBX88wFJy9C", "msg": "!in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person->this/Class->this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-30 22:18:31"} {"_id": "ppBRkswMBE6RbS6uY", "cmd_i": 13, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches implies some p : Person, g : Group | c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Person | (some c : Class, g : Group | c->p->g in Groups) implies some t : Teacher | t->c in Teaches and t->p in Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "o38KvADtQj3KpSgu4", "msg": "The name \"c\" cannot be found.", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-27 15:31:47"} {"_id": "cs9e9XGA3npCoc2Wo", "cmd_i": 6, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in Teaches.~Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "icZmDDCpHPZyZy7fj", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 20:31:14"} {"_id": "icZmDDCpHPZyZy7fj", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uEoWooCAddxcDSopP", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-12 20:31:07"} {"_id": "Fd43ZWMH6cSv4TxpP", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher, c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c : Class | some p : Person, g : Group, t :Teacher | c->t->g in Groups implies c->t in Teaches \n}\n\n \n\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QrrGyaL6tSty8GqdY", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Person}\nRight type = {this/Person->this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-11-3 00:18:23"} {"_id": "NqKMF5rFc5gomGPrf", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher,c:Class | t->c in Teaches\n }\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c: Class | some t:Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | all c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xkADZeG5CBH8La2sE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 11:14:52"} {"_id": "CyRuF6kWpZyQzWWah", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student implies p not in Teacher) and (p in Teacher implies p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | (p not in Student implies p in Teacher) and (p not in Teacher implies p in Student)\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher, c1,c2:Class | (t->c1 in Teaches and t->c2 in Teaches) implies c1=c2 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall t:Teacher, c:Class | (some g:Group | c->t->g in Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bavHaLR9btgATtT8e", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2020-1-7 17:58:36"} {"_id": "7FG84ih7wW4YJw5jP", "cmd_i": 4, "code": "/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n\n\n\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Student or p in Teacher\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tall p:Person | some c : Classe | p->c in Teaches \n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uHabBXA4jcmWT4zpY", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-2 10:42:33"} {"_id": "xScn4LLek47fXgf8t", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t\n \tTeacher in Teaches.Class\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rH22m8uER83XjGk2w", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-1 17:54:02"} {"_id": "LeNXJ34edC7tT95fT", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 Teacher or p in Student\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c1,c2:Class,t:Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\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\tall c:Class | some g:Group, t:Teacher | c->t->g in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WCuq85uzP5vmCkWFC", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-10-2 15:08:57"} {"_id": "hAx67JdyAuQDx6RWM", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher,t2:Teacher,c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Person,c:Class | studentInClass[s,c] implies some p : Person | p->s in Tutors and p->c in Teaches\n}\n\npred studentInClass[s:Student,c:Class] {\n\tsome g:Group | c->s->g in Groups\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mLpz9RXQ7z5eW8s9r", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 11:01:24"} {"_id": "59kNCGSdq7PteNFkr", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bGqiZh5CaRkxmjgcH", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:48:09"} {"_id": "ousdZ59mMrcEWtz5b", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c : Class , t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c,d:Class | t->c in Teaches and t->d in Teaches implies c=d\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 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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wD2QahEYfc7Avqzkw", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-9-26 10:38:09"} {"_id": "JZnaJM4LYHSWZHRBG", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n \tall p:Person | p not in Teacher \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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 classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t1,t2:Teacher | some c1:Class | t1->c1 in Teaches and t2->c1 in Teaches implies t1=t2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PoEtwyBHkJqNLKzGX", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-28 17:02:25"} {"_id": "AAnNi2upC56K3jdPc", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 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\npred inv11 {\n all c:Class,g:Group | some c.Groups.g implies some t:Teacher | t->c in Teaches\n}\n\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | g in t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some t:Teacher | some s.(c.Groups) and some t.(c.Groups) implies t in s.^~Tutors\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person |some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "Ye6L7qizYcgqyHARE", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-21 11:41:03"} {"_id": "bnaYP6ys4ALEG9sbg", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\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 \t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\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 Teaches.c\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\npred inv9 {\n \t\n \tall t:Teacher | lone t.Teaches \n \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student|some g:Group| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,s:Student,g:Group | c->s->g in Groups implies some t:Teacher | c->t->g in Groups\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \t\n \n \t\n \tall t:Teacher | some c:Class,g:Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n \t\n \t\n \tall s:Student, t:Teacher | s not in Person.Tutors.^Tutors and t not in Person.~Tutors.^~Tutors\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^(~Tutors)\n}", "derivationOf": "NnahnRbpkKq7Zreaf", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-8 11:19:58"} {"_id": "tR8wKsxJ5MbBWrh8H", "cmd_i": 9, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student implies p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome c:Class, t:Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some c:Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | c in t.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\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 | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | s.Group in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dCfMmY6KkdHHvjXYt", "msg": "This cannot be a legal relational join where\nleft hand side is s (type = {this/Person})\nright hand side is this/Group (type = {this/Group})", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2020-1-21 16:51:28"} {"_id": "YopcSWQwJ9Qb74buE", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in 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 classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oR6r63Kue5Siaw3GP", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-11 20:58:52"} {"_id": "zhvi4bc5XMmeWSFdD", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* 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\tno Teacher\n}\t\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dd6DWMoj4m6LwEhQF", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-12-2 12:16:37"} {"_id": "3TqPuqHYMkvxKX8xH", "cmd_i": 1, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p : Person | p in Student implies not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "B9tQxqLi2v6bQwrLY", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:08:01"} {"_id": "rfToPyGrra3MB3sAy", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p: Person | p in Student implies p not in Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | t->some c : 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wgEG3cbPrzE84ewJn", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-9-26 10:31:36"} {"_id": "gSuKMQFdS42oCHckt", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p:Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student 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\npred inv5 {\n\tsome t:Teacher, c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | (some c:Class | t->c in Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some t:Teacher | t->c in Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t1:Teacher, t2:Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SM5aw7s8jgenH6def", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-2 11:30:29"} {"_id": "5RQFMfJnt8TGRPco4", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MCZEA5xDRfnrmGzC9", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-11-10 14:52:37"} {"_id": "7R4pXR78SztXTYTmm", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class , 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\tall c:Class | some c.Groups implies some t:Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall p:Person | p in Teacher implies some g:Group | p in Class.Groups.g\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t Person.^Tutors in Student and Person.^~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | s in c.Groups.Group \n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Tutors\n}", "derivationOf": "bDYMTLWxvDMW4ypBo", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-12-1 18:34:00"} {"_id": "7nLpyqxLDZnM8DaXr", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hXDLd7F2fpkQmpotv", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2020-1-7 13:18:21"} {"_id": "ZpLgbELcj9TS2zfhw", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t implies p not in Teacher\n \t\n \t\n \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t or p in Teacher\n \tPerson in Student + Teacher \n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t Teacher in Class.~Teaches\n \t\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~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "v7JALfW9sGmPMw9vg", "original": "YH3ANm7Y5Qe5dSYem", "sat": 0, "time": "2019-10-12 20:35:18"} {"_id": "e4yrDSXwujyLKrm7i", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nall p : Person | p in Student or p in Teacher\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\nsome x : Teacher | x 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "w9fh6nJRcFsRyDaJa", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "YH3ANm7Y5Qe5dSYem", "sat": 1, "time": "2019-9-26 10:15:44"} {"_id": "fQz9JGAeemn5mfpRP", "cmd_i": 8, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Teacher.Teacher | one Teacher \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\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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RGbav3Dw9Zg5brHHy", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-12 18:53:50"} {"_id": "tvfsHjGAWnEzEH6k9", "cmd_i": 5, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and 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 classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall x : Teacher | lone 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3s3xqYvLkJyJm6YpW", "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": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-10 17:16:03"} {"_id": "bDwnCy3Qktdckxzvi", "cmd_i": 3, "code": "/**\n * First-order logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using only Alloy's first-order \n * logic:\n *\t- terms 't' are variables\n *\t- atomic formulas are either term comparisons 't1 = t2' and \n * 't1 != t2' or n-ary predicate tests 't1 -> ... -> tn in P' and \n * 't1 -> ... -> tn not in P'\n *\t- formulas are composed by \n *\t\t- Boolean connectives 'not', 'and', 'or' and 'implies'\n *\t\t- quantifications 'all' and 'some' over unary predicates\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson\n}\n\n/* There 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 the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* Assuming a universe of 3 persons, the tutoring chain of every\n * person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RNAeYLEJM9jQ4WHp2", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "YH3ANm7Y5Qe5dSYem", "sat": -1, "time": "2019-10-3 10:14:12"}